Closed (fixed)
Project:
FAQ_Ask
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
20 Oct 2010 at 15:24 UTC
Updated:
3 Jan 2014 at 02:04 UTC
Jump to comment: Most recent
I don't really know if it's a FAQ Ask issue, but it only happens when I save a new "ask a question" :
warning: function_exists() expects parameter 1 to be string, array given in
includes\form.inc on line 769.
This message is on the screen after I save the new question, and the question is saved. Running PHP 5.3.0, Drupal 6.19 and FAQ_Ask 6.x-2.x-dev and FAQ 6.x-1.x-dev.
Would appreciate any ideas on tracking it down.
Comments
Comment #1
verta commentedWell, I took a shot at the code, even though I am not at all a PHP coder. Seemed to me that the form validation (form.inc) was somehow annoyed at some null value in an array.
from form.inc, lines 756 to 762 (the error line)
So I commented out line 217 in faq_ask.module, the area that was commented as being concerned with validating the email field.
And whadda-ya-know, that got rid of the error. It works fine with and without the "Notify by E-mail (optional)" check box checked.
Here is the code block before I commented out that line:
after
Edit: We do not allow anonymous question submission, so this is only for authenticated users, so the email address field is hidden on our site.
Comments welcomed.
Comment #2
verta commentedAlternate solution, after reading http://drupal.org/node/768260 it seemed better to do it this way, so it would work if/when we enable anonymous submissions.
On line 222 of faq_ask.module:
before
222: $form['#validate'][] = 'faq_ask_form_validate';
after
222: $form['#validate'] = array('faq_ask_form_validate');
Comment #3
proindustries commentedJust ran into this as well, and the fix in #2 worked great...
Comment #4
jlea9378 commentedThe fix in #2 above worked for half of my problem (I was getting two errors, now only get one).
I still get this when asking a question while Better Select is enabled:
warning: Invalid argument supplied for foreach() in /var/www/html/drupal_test/sites/all/modules/betterselect/betterselect.module on line 227.
Comment #5
stenjo commentedImplemented the fix in #2 into the 6.x-2.x-dev version. Please verify that this fixes the problem
Comment #6
jlea9378 commentedLooks good in the dev version so long as the Better Select module isn't enabled. Otherwise I get this:
warning: Invalid argument supplied for foreach() in /var/www/html/drupal_test/sites/all/modules/betterselect/betterselect.module on line 227.
Comment #7
summit commentedSubscribing, greetings, Martijn
Comment #8
jlea9378 commentedI installed the latest dev release (6.x-2.x-dev (2011-Jul-20)) and the problem has now returned.
warning: function_exists() expects parameter 1 to be string, array given in /var/www/html/drupal_test/includes/form.inc on line 770.
Comment #9
stenjo commentedIs this still a problem with the dev version? When I check the code, line 222 says
$form['#validate'][] = 'faq_ask_form_validate';Comment #10
stenjo commentedMy bad! Found out that I had messed with the verisoning, Should be fixed in the 6.x-2.x version now.