Problem/Motivation
Under the right conditions (see below for an example), the "admin/config/content/panelizer/node/[bundle].default/list" page will return a blank page and generate a bunch of errors (not displayed of course). The next successful page load will show the errors, like:
- Warning: array_key_exists(): The first argument should be either a string or an integer in ctools_get_plugins() (line 240 of /ctools/includes/plugins.inc).
- Warning: array_key_exists(): The first argument should be either a string or an integer in ctools_get_plugins() (line 331 of /ctools/includes/plugins.inc).
- Warning: array_key_exists(): The first argument should be either a string or an integer in ctools_get_plugins() (line 341 of /ctools/includes/plugins.inc).
- Warning: Illegal offset type in isset or empty in ctools_plugin_load_includes() (line 489 of /ctools/includes/plugins.inc).
- Warning: Illegal offset type in isset or empty in ctools_plugin_load_includes() (line 489 of /ctools/includes/plugins.inc).
- Warning: Illegal offset type in isset or empty in ctools_plugin_load_includes() (line 489 of /ctools/includes/plugins.inc).
- Warning: Illegal offset type in isset or empty in ctools_plugin_load_includes() (line 489 of /ctools/includes/plugins.inc).
- Warning: Illegal offset type in isset or empty in ctools_get_plugins() (line 344 of /ctools/includes/plugins.inc).
- Warning: Illegal offset type in ctools_get_plugins() (line 344 of /ctools/includes/plugins.inc).
- Warning: Illegal offset type in ctools_get_plugins() (line 354 of /ctools/includes/plugins.inc).
- Warning: Invalid argument supplied for foreach() in panelizer_export_ui_switcher_page() (line 748 of /panelizer/panelizer.module).
- Notice: Undefined index: redirect in panelizer_export_ui_switcher_page() (line 755 of /panelizer/panelizer.module).
- Warning: Invalid argument supplied for foreach() in panelizer_export_ui_switcher_page() (line 755 of /panelizer/panelizer.module).
The errors result from an invalid menu router item produced by executing panelizer_defaults_ui::hook_menu()
twice on the same set of menu items. The page arguments are invalid and the page callback (panelizer_export_ui_switcher_page()
) responds with a blank page.
To reproduce the problem, install a site with panelizer and pathauto enabled. The invalid menu router item will exist after submitting the install_configure_form
(where you set the administrative user name and password, etc.). Enable panelizer on a content type and attempt to view the "list" URL mentioned above.
Proposed resolution
Add a condition in panelizer_defaults_ui::hook_menu
to check whether a menu item has been "processed" by panelizer; if it has do not process it again.
Remaining tasks
Review and test.
User interface changes
None.
API changes
None.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2232877-avoid-duplicate-processing.patch | 1.31 KB | solotandem |
Comments
Comment #1
solotandem CreditAttribution: solotandem commentedComment #2
solotandem CreditAttribution: solotandem commentedAttached patch implements the proposed resolution.
Comment #3
Chris Burge CreditAttribution: Chris Burge commentedI can confirm the errors reported by solotandem. In my use case, I was attempting to deploy Panelizer configuration using the Features module. After applying the patch from #2, the errors are no longer present.
Comment #4
DamienMcKennaCommitted. Thank you both!