This notice is being thrown anytime you try and change the "Style" of a Fieldable Panels Panes from the Panels Content screen.

Notice: Undefined index: title in panels_renderer_editor->ajax_style_type() (line 948 of [...]/panels/plugins/display_renderers/panels_renderer_editor.class.php).

URL: [...]/panels/ajax/editor/style-type/10/pane/1948

In addition, it just says Pane styles for "" - where the title is blank. The actual assigning of the style works fine, but it's throwing a bunch of errors to the log. Anyone experience this and have any idea on a fix?

It's happening in the 7.x-1.5+18-dev release, but I noticed it since 7.x-1.5+15-dev.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nsciacca’s picture

Issue summary: View changes
heddn’s picture

Status: Active » Closed (duplicate)
Related issues: +#1696436: Notice from editing Fieldable pane CSS styles
kepford’s picture

@nsciacca I'm seeing the same issue. I'm curious about what modules you have install and how you can reproduce this. What kind of panel panes does this affect?

nsciacca’s picture

I'm using Panelizer for a few content types to render displays I created using ctools plugin hooks for layouts and styles. The layouts are pretty basic with a bunch of regions and markup specific to the theme (based on Foundation 5). The style plugin allows for some options that essentially add classes to these panes & regions like "medium-6" which makes the pane take up 50% of the parent row on browsers larger than 768px or "gray-background" which assigns a background color.

When assigning these "Styles" the panel panes that are affected are all Fieldable Panels Pane type. Regular custom content panes, views panes, block panes, etc have the Title populated and no undefined warning. I have a variety of these FPP like "accordion", "gallery", "pull quote", "media teaser", "slideshow" that allow the page to be designed and assembled by the content editors.

I've tried to track it down the warning and it has to do with the subtype of the pane being a "fpid:xxxx" format because the FPP is actually an instance of a fieldable pane type, instead of a specific item like a view pane, or block pane with standardized ids. The problem is that "fpid:xxxx" format is passed along and is eventually used to render the right piece of content, so I wasn't able to figure out how to supply ctools with the right information to both render it properly and suppress the warning/display the correct title.

kepford’s picture

Modules

Ctools 7.x-1.6
Classy Panel Styles 7.x-1.0-alpha1
Fieldable Panels Panes 7.x-1.5+36-dev
Panelizer 7.x-3.1+99-dev
Panels 7.x-3.5

Steps to reproduce:

Change the style of a Fieldable Panel Panel. The custom or Classy Panel Style must load a form to trigger the notice.

The root issue appears to be in ctools/includes/content.inc ctools_content_get_subtype() on line 192. The expected value of $subtype_id would be the FPP bundle name but the value currently is something like "fpid:157".

Specifically this block of logic starting on line 191 of ctools/includes/content.inc is never true.

$subtypes = ctools_content_get_subtypes($type);
    if (isset($subtypes[$subtype_id])) {
      $subtype = $subtypes[$subtype_id];
    }

I have a suspicion that using the UUID module when you create the FPP instance might resolve it.

kepford’s picture

So UUID does not affect this issue. The issue is the $subtypes[$subtype_id] does not exist.

$subtypes = ctools_content_get_subtypes($type);

DamienMcKenna’s picture

Status: Closed (duplicate) » Active

@kepford: Which suggests that either FPP is not registering something correctly, or CTools is not loading something correctly, possibly be because FPP is not telling it to.

Tell me, is there a difference depending on whether the FPP is set to be reusable?

kepford’s picture

Bingo!!! If the FPP is reusable it is returned from ctools_content_get_subtypes($type); in the $subtypes array.

kepford’s picture

The query in the file fieldable_panels_panes/plugins/content_types/fieldable_panels_pane.inc and function fieldable_panels_panes_fieldable_panels_pane_content_type_content_types() has a WHERE clause that only returns results for reusable panes. Refactoring this query and/or function could be the solution.

kepford’s picture

Status: Active » Needs review
FileSize
812 bytes

Damien, I have not throughly tested this patch yet but it does resolve the notices issue for me.

OK, wrong patch file!

Status: Needs review » Needs work

The last submitted patch, 10: classy_panel_styles-undefined-render-handler-2416845-1.patch, failed testing.

kepford’s picture

Status: Needs work » Needs review
FileSize
783 bytes

OK, here is the correct patch.

DamienMcKenna’s picture

@kepford: did you check if this breaks the whole"reusable" concept by forcing all FPPs to be reusable?

kepford’s picture

Status: Needs review » Needs work

Ok, just tested for that and it does indeed make all of the FPP's show up under miscellaneous. Back to the drawing board.

DamienMcKenna’s picture

It may ultimately be a CTools limitation, I'll ping japerry about it.

DamienMcKenna’s picture

So the "[modulename]_[pluginname]_content_type_content_types" function is supposed to return a list of content type plugins that are active. However, for some reason the AJAX system is using that to determine whether the pane exists and can be styled.

Looking at the code in ctools_content_get_subtype(), I wonder if maybe Fieldable Panels Panes should implement the 'content type' callback?

kepford’s picture

Based on my rough hacking on this today I think Fieldable Panels Panes should implement the 'content type' callback. Maybe basing it on ctools_entity_field_content_type_content_type().

kepford’s picture

If we add ctools_entity_field_content_type_content_type as a 'content type' callback it resolves the issue but creates another one. Editing the styles of a pane works fine but you can no longer create a new FPP. You are presented with the following message.

The pane entity referenced does not appear to be valid. It was probably deleted and you should remove this pane.