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

sbit.io’s picture

I've seen this since our change to PHP 5.3 and the change has fixed it.

Thanks!

sbit.io’s picture

Issue tags: +PHP 5.3 compatibility
niteman’s picture

Subscribing

memcinto’s picture

Applied 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

jimmyko’s picture

I found the same error and fixed it in my site already. I add a patch here.

tripper54’s picture

Status: Active » Needs review

changed status

hargobind’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Confirmed that the patch in #5 fixes the issue.

grzesag’s picture

Experienced 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