The objects of class panels_display are reusable, so their configuration (including context) may be changed many times during panel rendering, so I suggest to store display context data in renderer and pass renderer object to pane and region theme functions. The patch is attached.
Description of the problem.
Using panelizer and views, create a panel which contains the same panels with other contexts. In panels_display::render(), $renderer->display->context will be different in hook_panels_pre_render() and hook_panels_post_render(). The problem appears in https://drupal.org/project/panels_style_collapsible module which tries to construct region title from display context and gets the incorrect context (see #2218489: Incorrect use of display context in region render theme).
Comment | File | Size | Author |
---|---|---|---|
#1 | panels-add_display_context-2218487-1.patch | 2.36 KB | maximpodorov |
Comments
Comment #1
maximpodorov CreditAttribution: maximpodorov commentedComment #2
maximpodorov CreditAttribution: maximpodorov commentedComment #3
maximpodorov CreditAttribution: maximpodorov commentedPlease review this patch for committing. Current Panels behavior is not correct in this sense.
Comment #5
andypostMaybe better implement a $display->original_context variable to store initial
Comment #6
maximpodorov CreditAttribution: maximpodorov commentedWhy?
Comment #7
maximpodorov CreditAttribution: maximpodorov commentedUnfortunately, no one reviews this patch. Maybe I'm the only person who suffer this problem since it breaks recursive panels only. But I suggest to add this fix to the next Panels release.
Comment #8
ddrozdik CreditAttribution: ddrozdik as a volunteer commentedHi Maxim,
Please re-roll this patch, and I will review it. And provide steps for reproduce bug described by you.