When using e.g. Panels Everywhere to manage the site, the body_classes_to_remove or body_classes_to_add from the PE display are not always added to the page display.

CommentFileSizeAuthor
#1 panels-n2330413-1.patch1.47 KBDamienMcKenna
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

FileSize
1.47 KB

The problem stems from panels_panel_context_render() where it only adds the new values if there are not ones assigned already.

DamienMcKenna’s picture

Title: body_classes_to_remove/body_classes_to_add not correctly added » body_classes_to_remove/body_classes_to_add not added correctly
DamienMcKenna’s picture

Status: Active » Needs review

Michelle’s picture

Status: Needs review » Reviewed & tested by the community

To test, I edited the "default site template" for PE and put "not-front" in the classes to be removed and "added-class" in the classes to add. I have a test custom page that has both of those empty in the variant I'm using. When I viewed the test page without the patch, those changes did not pass from the default site template to my custom page. With this patch, the changes to the classes show up when the page is viewed as they should.

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Good catch, Michelle!

I compared both patches, the one from #2188787: Custom body classes not working for site template variant includes this patch and adds another little fix too. Closing this one.