Hi,
when i click submit on admin/config/content/wysiwyg/profile/full_html/edit or admin/config/content/wysiwyg/profile/pelny/edit or all admin/config/content/wysiwyg/profile/*/edit i get this error on site admin/config/content/wysiwyg

Warning: Invalid argument supplied for foreach() w drupal_alter() (linia 980 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/module.inc).
Warning: Invalid argument supplied for foreach() w drupal_alter() (linia 980 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/module.inc).
Warning: Invalid argument supplied for foreach() w drupal_alter() (linia 980 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/module.inc).
Warning: Invalid argument supplied for foreach() w drupal_alter() (linia 980 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/module.inc).
Warning: Invalid argument supplied for foreach() w drupal_alter() (linia 980 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/module.inc).
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '' was given w theme_get_registry() (linia 249 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/theme.inc).
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '' was given w theme_get_registry() (linia 249 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/theme.inc).
Warning: Invalid argument supplied for foreach() w drupal_alter() (linia 980 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/module.inc).
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '' was given w theme_get_registry() (linia 249 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/theme.inc).
Warning: Invalid argument supplied for foreach() w drupal_alter() (linia 980 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/module.inc).
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '' was given w theme_get_registry() (linia 249 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/theme.inc).
Warning: Invalid argument supplied for foreach() w drupal_alter() (linia 980 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/module.inc).
Warning: Invalid argument supplied for foreach() w drupal_alter() (linia 980 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/module.inc).
Warning: Invalid argument supplied for foreach() w drupal_alter() (linia 980 z /home/esperant/domains/esperanto.pl/public_html/d7/includes/module.inc).

Comments

twod’s picture

Status: Active » Postponed (maintainer needs more info)

Looks like a function is missing or has been renamed, but perhaps the theme cache has not caught up.
Does flushing Drupal's caches help? (Performance page)

To properly debug this, one would either have to insert some debugging code to print out a stack trace or walk the stack in a debugger to know when the calls into includes/module.inc and includes/theme.inc happen. The errors we see now provide too little info to tell what goes wrong.

sun’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Sorry, without further information this issue can only be closed as not reproducible.

Feel free to re-open this issue if you want to provide further information. Thanks.

NaX’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Component: User interface » Code
Priority: Major » Normal
Status: Closed (cannot reproduce) » Active

I am getting the same errors.

Warning: Invalid argument supplied for foreach() in drupal_alter() (line 982 of /usr/www/users/devsey/dcom/includes/module.inc).

Versions:

  • Drupal 7.8 using Commerce Kickstart Profile, running site in a sub folder not web root
  • wysiwyg 2.1 & Dev
  • TinyMCE 3.3.9.4
NaX’s picture

Status: Active » Needs review

Ok, I think I found the problem. For some reason you cant have a form field named "theme".

In wysiwyg_profile_form() in wysiwyg.admin.inc I changed $form['basic']['theme'] to $form['basic']['editor_theme'] and then added the following to the top of wysiwyg_profile_form_submit() after $values = $form_state['values'];.

  // We cant have a form field called theme.
  $values['theme'] = $values['editor_theme'];
  unset($values['editor_theme']);

I don't know why my errors and warnings went away when I renamed the theme field, but it did. There must be some sort of interaction between the FAPI and the theme registry. Maybe this is a core bug.

Additionally I am running PHP 5.2.6-1+lenny13.

I hope that helps.

twod’s picture

Status: Needs review » Closed (cannot reproduce)

@NaX, I doubt there's such a conflict since even Core's Color module uses a FAPI field named 'theme'.
All theme system interaction should happen via '#theme' and its relatives so it shouldn't look for/use a child named just 'theme'.

I have no good idea why changing the field name worked, but maybe a cache was cleared? Are you running APC or another opcode caching PHP extension?
It's the most plausible reason I can find, since the relevant code in drupal_alter() deals with calling module hook functions. If a function name was cached somewhere, but not actually available anymore, I can see why the OP's error could happen. Maybe something similar can cause the error you're seeing a few lines above.

I still can't reproduce the errors though. Unless it comes back if you undo the field name change, I'll close this.

victmo’s picture

I had the exact same problem.
In my case, this had to do with register_globals being ON.
Drupal requires this PHP configuration to be OFF.
Usually Drupal's .htaccess file would attempt to force this setting to OFF, but on some shared hosts this does not work.
If this is your case, create a file called php.ini in your drupal installation folder and add this line: register_globals = Off

You can check if it was successfully set to OFF in YOUR_SITE/admin/reports/status

Hope this helps :)