Closed (fixed)
Project:
Wysiwyg
Version:
6.x-2.4
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
27 Jun 2011 at 08:08 UTC
Updated:
25 Jun 2012 at 13:14 UTC
Hi! I'm using Drupal 6.22, Wysiwyg 6.x-2.4 and PHP 5.3.6.
Problem: when I attach a file when creating a node, I see the error: "warning: Parameter 2 to wysiwyg_form_alter () expected to be a reference, value given in / home / drupal / www / includes / common.inc on line 2892."
Perhaps this is due to the peculiarities of calling call_user_func_array () in PHP 5.3.
Sorry for my bad english> _ <
| Comment | File | Size | Author |
|---|---|---|---|
| bug.jpg | 161.92 KB | AyumuKasuga |
Comments
Comment #1
twodThis error most likely happens because another module is calling
drupal_alter()incorrectly so$form_stategets cloned instead of referenced.drupal_alter()uses a key called__drupal_alter_by_refto work around the issues withcall_user_func_array(), but that won't help unless people actually put references in there.As you can see in the error message, other modules also suffer because of this and there's nothing these modules can do about it. CCK had this problem a while back but it was fixed with the patch in #705512-32: drupal_alter('form'... called from content_add_more_js needs to pass $form_state as a reference.
I can not guess which module is creating this problem for you - at least not without a stack trace. I can only recommend that you make sure all modules are up-to-date and hope the calling module has fixed this.
If the problem is there, you can try inserting
or, if you have devel.module installed,
at the top of one of the functions mentioned in the errormessage. (
wysiwyg_form_alter()is in wysiwyg.module). Then you'll have to dig through that backtrace until you find from wheredrupal_alter()is being called and search for or create a bug report for that module.Comment #2
twodComment #4
memcinto commentedOK help me out here, if you would be so good. According to the backtrace, drupal_alter() is being called by drupal_prepare_form in includes/form.inc. However this call is formed correctly, so that can't be the problem.
Backtrace says:
drupal_prepare_form says,
Comment #5
AgaPe commentedIn wysiwyg.module you have to change the function declaration
function wysiwyg_form_alter(&$form, &$form_state) {to
function wysiwyg_form_alter(&$form, $form_state) {