Using about all the latest dev versions of all drupal modules (except core)
Directly after creating a clone of a page variant in Panels, this error appears:

Undefined index: body_classes_to_remove in panels_panel_context_edit_settings() 

Although not caused by the same action, it appears as one of the errors mentioned here:
http://drupal.org/node/1489914

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Yuri’s picture

to be complete, the error is:

Notice: Undefined index: body_classes_to_remove in panels_panel_context_edit_settings() (line 732 of /home/testsite/public_html/sites/all/modules/panels/plugins/task_handlers/panel_context.inc).
Notice: Undefined index: body_classes_to_add in panels_panel_context_edit_settings() (line 740 of /home/testsite/public_html/sites/all/modules/panels/plugins/task_handlers/panel_context.inc).
ltwinner’s picture

Getting the same error after cloning using Panels version 7.x-3.2

ltwinner’s picture

Flushed all caches, message has gone away now.

calefilm’s picture

Got the same error using 7.x-3.2. If I re-save it it goes away but i can't help from receiving the error in the first place.

intyms’s picture

I get the same error when i changed the administrative title of the variant (old title "Marfuri", new title "Product-display")

    Notice: Undefined index: body_classes_to_remove in panels_panel_context_edit_settings() (line 734 of X:\xampp-sites\for7\sites\all\modules\panels\plugins\task_handlers\panel_context.inc).
    Notice: Undefined index: body_classes_to_add in panels_panel_context_edit_settings() (line 742 of X:\xampp-sites\for7\sites\all\modules\panels\plugins\task_handlers\panel_context.inc).

I am using:
drupal 7.18
Chaos tools 7.x-1.2
Panels 7.x-3.3
I18n 7.x-1.8

sonicthoughts’s picture

+1 - is this something to be concerned about???

somatics’s picture

I'm seeing this on a bunch of panels on our site too, but I'm not sure if they were all cloned from other variants (we've had some of these panels on this site for 5 years).

Summit’s picture

Hi,

Can this be connected with the fact that the body-field is a different thing from Drupal 6 to Drupal 7.
My views and panels gives problems with the body-field after Update from D6-D7.
Greetings, Martijn

merlinofchaos’s picture

This error is not serious. The body_classes_to_remove feature was added later, but it appears the code does not properly deal with the fact that older panels won't have this set.

As a workaround, you can re-save (and then re-export, if necessary) the panels and it will make the notice go away.

The error *is* annoying, it shouldn't be happening. There needs to be an empty() check where the item is used; that can prevent the notice. If anyone wants to write the patch, it would be appreciated.

SocialNicheGuru’s picture

Issue tags: +Panels Everywhere

Just adding here:
enabled panels_everywhere module
cloned a variant for the site template
the error showed up

ergophobe’s picture

Assigned: Unassigned » ergophobe
Issue summary: View changes
Status: Active » Needs review
FileSize
1.36 KB

This patch fixes it for me. It's nothing but an empty check as merlinofchaos suggests.

DamienMcKenna’s picture

FileSize
1.36 KB

A minor adjustment.

DamienMcKenna’s picture

Assigned: ergophobe » Unassigned
DamienMcKenna’s picture

Michelle’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #12 applies cleanly and fixes the error when tested using the repro steps in #10.

mrjmd’s picture

japerry’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +SprintWeekend2015

Ahh yah thats simple. Fixed!

Status: Fixed » Closed (fixed)

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