When I submit a form with a private upload, I receive the following error message:
"warning: function_exists() expects parameter 1 to be string, array given in /var/www/includes/form.inc on line 771."
I have tracked down the issue and propose the following solution:
Line 349 of private_upload.module reads as follows:
$form['#validate']['private_upload_form_validate'] = array('');
The Form API expects the name(s) of the form validation functions to be present in an array assocaited with $form['#validate']. So, the correct code looks as follows:
$form['#validate'][] = 'private_upload_form_validate';
Comments
Comment #1
sbit.io commentedI've seen this since our change to PHP 5.3 and the change has fixed it.
Thanks!
Comment #2
sbit.io commentedComment #3
niteman commentedSubscribing
Comment #4
memcinto commentedApplied the above patch and it fixed my error message problem. Hope this ends up in a new release of the private_upload module, along with: http://drupal.org/node/812194#comment-4460378
Comment #5
jimmyko commentedI found the same error and fixed it in my site already. I add a patch here.
Comment #6
tripper54 commentedchanged status
Comment #7
hargobindConfirmed that the patch in #5 fixes the issue.
Comment #8
grzesag commentedExperienced the same warning when moving Drupal 6 from php 5.2 to php version 5.3 I tracked the issue and fixed it, I wish to find this page first. Can confirm that provided patch fixed the problem