drupal

Drupal form submission

自闭症网瘾萝莉.ら 提交于 2019-12-25 01:55:58
问题 I have created a form in drupal. I don't know how to handle the submission. I want to do some selection from database with the values i get from form. Here is my code to create form function q_search_form() { $form['qsearch']['category'] = array( '#type' => 'select', '#options' => array(0 => 'Any', 1 => 'Automotive', 2 => 'Real Estate'), '#attributes' => array('class' => 'drop-box'), '#prefix' => '<table width="470"><tr><td width="170">Select Category</td><td width="300">', '#suffix' => '</td

PHP object property notation

人盡茶涼 提交于 2019-12-25 01:29:40
问题 I suddenly stuck here: $source = (object) array( 'field_phone' => array( 'und' => array( '0' => array( 'value' => '000-555-55-55', ), ), ), ); dsm($source); $source_field = "field_phone['und'][0]['value']"; dsm($source->{$source_field}); //This notation doesn't work dsm($source->field_phone['und'][0]['value']); //This does dsm() is Drupal developer function for debug printing variables, objects and arrays. Why $source object doesn't understand $obj->{$variable} notation? Notice: Undefined

Why does each field appear in a new row?

筅森魡賤 提交于 2019-12-25 01:26:09
问题 I have made this table: I have 2 array's UGentArray and InternshipsArray. How can I set these in my table? Instead of "Row column 1 data" and "Row column 2 data". My question is: I want the values from UGentArray and InternshipArray as 2 columns under each title UGentID and Internships. How would one modify the following code so that each field appeared in a new table row (instead of fields in adjacent cells within the same row)? // Make table and display on screen. $tbl_header = array();

Batching php's fgetcsv

故事扮演 提交于 2019-12-25 00:49:16
问题 I have a fairly large csv file (at least for the web) that I don't have control of. It has about 100k rows in it, and will only grow larger. I'm using the Drupal Module Feeds to create nodes based on this data, and their parser batches the parsing in groups of 50 lines. However, their parser doesn't handle quotation marks properly, and fails to parse about 60% of the csv file. fgetcsv works but doesn't batch things as far as I can tell. While trying to read the entire file with fgetcsv, PHP

How to create a custom token for the Message module?

♀尐吖头ヾ 提交于 2019-12-25 00:43:07
问题 I have a site with Drupal, as well as the modules "Message" and "Token". I created a custom module based on the module "Message example". I created for entities, a display mode called message_activity_stream . I created a token to display the rendered entity of the nodes and it works. Now I want to create a custom token to display the rendered entity of the author of the message. How to create a custom token in my module, to display the rendered entity message_activity_stream of the user

Php and javascript working on localhost but not on hosted website

天涯浪子 提交于 2019-12-25 00:41:01
问题 I implemented a search form that has 3 drop down <select> tags The first 2 drop downs have static options while I used a javascript to create the options of the third drop down. The javascript is based on onchange event of 2nd drop down and is stored in searchideas.js file This searchideas.js file calls datasupplier.php using GET method through XMLHttpRequest . All works fine on my localhost but when I hosted it on the live website, the options for the third drop down does not gets generated.

How to access phpmyadmin on DDEV Windows 10 pro localhost with SSL record too long error

别等时光非礼了梦想. 提交于 2019-12-24 20:38:49
问题 I am using DDEv and Docker with Windows 10 pro to set up a localhost install of drupal 8.8 using Composer. I have set up and configured the local drupal installation (it is a fresh install) and it appears to be running correctly, but in the admin section of the drupal site I receive a warning to change write permissions of sites/default/settings.php. I tried to change settings using Filezilla, but it appears that local files in Filezilla do not provide access to write permissions? When I

Php recursion issue not sending back values

独自空忆成欢 提交于 2019-12-24 20:30:22
问题 Here is the code that I am going to use for solving my complicated issue, that I posted earlier. Logic behind that is - on every iteration of the recursion, function should decrease $wa for $amount, that has been already proceeded, and calculate new $wa, to find new $amount, until system could not find the $amount in table that will be bigger then resulted $wa, and proceed it as last iteration. Code is returning nothing, when trying to devel it, no errors, no echo. What am I doing wrong? $wa

Error enabling MongoDB module

余生颓废 提交于 2019-12-24 19:22:20
问题 I am trying to use MongoDB with drupal 7 site. The database is hosted remotely on mongolab.com. I have installed the MongoDB Driver on my dedicated server and it added extension = "mongo.so" to my php.ini automatically. Now, when I try to enable MongoDB module, it gives me this error: Mongodb requires the PHP MongoDB extension to be installed. (Currently using Mongodb Not found) Any ideas why? 回答1: 1) In your phpinfo() screen, make sure the Configuration file Path and Loaded Configuration

How do I fix Lightbox2 problems using $.noConflict()?

家住魔仙堡 提交于 2019-12-24 19:12:08
问题 I've imported images to my site. I want to open these images with lightbox2. I've installed the lightbox2-drupalmodule and that works on my frontpage (www.chirowijkoersel.be), but it doesn't work on the pages where I imported images. Lightbox does work with Opera. I've also noticed that the lightbox2-module adds a class to the images in Opera and on the frontpage with every other browser. Links: Images page Frontpage Edit: I've done some research, and I think the problem is caused by the