The problem is described here: #2218487: Display object may change during panel rendering
Using $vars['display']->context in theme_panels_style_collapsible_render_region() can produce incorrect title if display object is reused by different renderers. So I suggest to use renderer itself to get context.
If the patch from #2218487: Display object may change during panel rendering will be accepted, the attached patch can solve the problem.

Comments

maximpodorov’s picture

Status: Active » Needs review
StatusFileSize
new825 bytes
beltofte’s picture

Status: Needs review » Postponed (maintainer needs more info)

Thanks for the patch. Just to be 100% sure, we are waiting on #2218487: Display object may change during panel rendering to be committed before the patch attached to this issue should be applied, right?

maximpodorov’s picture

Right.

maximpodorov’s picture

Oh, no. The patch can be applied right now (it will not break anything), but it will fix the current issue only after fixing that issue in Panels module.

maximpodorov’s picture

StatusFileSize
new737 bytes

The patch is re-rolled.

ddrozdik’s picture

Status: Postponed (maintainer needs more info) » Needs review
ddrozdik’s picture

Status: Needs review » Postponed

I do not see sense add this patch, since parent issue still opened. Let's resolve parent issue first, and then return back to this one.
Maxim, please re-roll patch in parent issue and provide cases when we need this patch.