When changing the layout of a page, an error is logged to the dblog. The error is "Invalid plugin module/type combination requested: module panels and type layout." This was introduced quite a while ago, between release 3.5 and 3.6, and is still occurring on the latest dev versions of Panels and CTools.

The error is logged when changing layout on page manager pages, on panelizer defaults, and on panelized nodes. It is logged regardless of the interface used to change layout (IPE or standard).

To reproduce:

  1. Install Drupal 7.50.
  2. Download and enable CTools 1.9 and Panels 3.6; also enable Page Manager.
  3. On admin/structure/pages, add a custom page as a panel variant. Choose the single-column layout in the 1 column category. Accept all other defaults and update/save the page.
  4. Go to admin/reports/dblog.
  5. Note the success notice "Panels: saved display..."
  6. Go to admin/structure/pages.
  7. Click Edit link for the new page.
  8. Click the Layout link.
  9. Choose the 50/50 split layout in the 2 column category and click Continue.
  10. Click Update and save.
  11. Go to admin/reports/dblog.
  12. Note the error message "Invalid plugin module/type combination requested: module panels and type layout."

It appears that the fix in #2434991: Changing layout shows the display settings form without saving it introduced this error. That commit added a programmatic call to submit the display settings form for the layout.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cboyden created an issue. See original summary.

dsnopek’s picture

Status: Active » Needs review
FileSize
1.26 KB

Here's a patch that fixes this!

The fix itself is simple: the code in panels_edit_display_settings_form_submit() is using panels_plugin_get_function('layout', ...) whereas the name of the plugin type is actually 'layouts' (with an 's')

However, tracking down how this ever worked with an incorrect plugin type name, is a little more complicated!

Basically, the two forms (panels_edit_display_settings_form() and panels_change_layout()) both put the layout plugin in $form_state['layout'], except that the former is storing the full plugin definition as an array, and the latter is only storing the layout name as a string.

Looking at the code for panels_plugin_get_function():

function panels_plugin_get_function($plugin, $which, $function_name) {
  ctools_include('plugins');
  if (is_object($which) || is_array($which)) {
    return ctools_plugin_get_function($which, $function_name);
  }
  else {
    return ctools_plugin_load_function('panels', $plugin, $which, $function_name);
  }
}

If $which is an array, it completely ignores the passed in $plugin and just grabs the function name off the plugin definition, so it doesn't matter that the plugin type is wrong.

However, if a string is passed in, then it has to load the plugin definition at which point it uses the $plugin and that's where we're getting an error because the plugin type name was wrong.

Please let me know what you think!

cboyden’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, this is working great in my testing.

japerry’s picture

Status: Reviewed & tested by the community » Fixed

lol. fixed.

  • japerry committed 56d2507 on 7.x-3.x authored by dsnopek
    Issue #2792651 by dsnopek: Watchdog error when changing layout
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.