Executive summary ;-)

To avoid WSOD on php 5.4: In panels.module change

function template_preprocess_panels_pane($vars)


function template_preprocess_panels_pane(&$vars)

This fix is committed but a release isn't coming soon since nobody is maintaining the 6.x branch (see #1774796: Plan for Panels v6.x-3.11 release (PHP 5.4 fix) where someone actually volunteered to maintain it).


I'm in the process of updating some physical servers which use Windows 2008 R2 as their OS (due to software requirements of the WebApp being hosted) and as such they use the Uniform Server as their secured-for-production WAMP stack.


Once I ported one such WebApp to its new server with the latest Uniform Server (version Coral 8.4.0), everything came up as expected with the only exception being all Panels Pages and Panels Nodes were empty. One such Panels Page that uses the rounded rectangle style for each of the blocks or Views it displays shows up with empty rounded rectangles.

Now, the blocks and Views in the Panels pages appear to be getting called because logic I have in the blocks is getting executed even though the Panels Pages appear empty.

The "only" difference between the version of these sites where Panels behaves normal and where the pages are empty are:

  • Updated PHP from version 5.3 to version 5.4
  • attempting to see if its fixed in a new version, the "bad" version is running Panels 6.x-3.x-dev 2012-Jan-21

I tested the pages in IE9 and Firefox 10.0.2, getting the same result. Reading a recent post here around a single column Panels display, I went and verified that the panels CSS is being loaded fine, and well as no javascript errors seem to be getting triggered...

I also have another version of the same site, on the same physical server, running a previous version of Uniform Server. That version's Panels Pages and Panels Nodes display fine...

I've attached a screen shot of one such empty Panels Page (the one that uses rounded rectangles for each block).

#4 panels.module.diff460 bytesNigelCunningham
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch panels.module.diff. Unable to apply patch. See the log in the details link for more information. View
empty_panels.jpg14.16 KBbsenftner
Members fund testing for the Drupal project. Drupal Association Learn more


NigelCunningham’s picture

Same seen here - seems to be PHP 5.4 specific. Working on finding the cause at the moment, and have it narrowed down to panels-pane.tpl.php not seeing the variables set as it expects.

NigelCunningham’s picture

Title: all panel pages and nodes displaying empty » PHP 5.4: all panel pages and nodes displaying empty

Update title since the PHP version seems to be the issue.

Letharion’s picture

FWIW, I run 7.x-3.0 on a stack of LAM + PHP 5.4 without issues.

NigelCunningham’s picture

Status: Active » Needs review
460 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch panels.module.diff. Unable to apply patch. See the log in the details link for more information. View

Got it. The definition of template_preprocess_panels_pane is wrong - it's missing the ampersand that is needed to make its argument be passed by reference.

[Edit: typo]

ptoly’s picture

Works for me...AND php 5.4 appears faster too!

NigelCunningham’s picture

Status: Needs review » Reviewed & tested by the community
Letharion’s picture

Assigned: Unassigned » merlinofchaos
tim.plunkett’s picture

Assigned: merlinofchaos » Unassigned
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

ir4georgia’s picture

Thanks, I recently upgraded to PHP5.4 and this was driving me crazy, since it didn't work but logged no PHP error

hansfn’s picture

Doesn't this bug warrant a new release? This is a show stopper for anyone using or planning to upgrade to PHP 5.4.

slewazimuth’s picture

Good catch with the & ampersand missing to change $vars to &vars and have it pass by reference.

amitkeret’s picture

+1 for posting a new release!!

I've been banging my head against the wall for the past two days trying to figure out what's wrong here.
Thank you so much for pinpointing the problem so beautifully.

I have a website on a live environment and a local environment. I recently wanted to work on something locally when I found that all my panels are empty. In my search for the culprit, I'd found issues talking about a problem in "Default" style for panes, in combinations with Views Slideshow... etc.etc.etc. Eventually I found this post, that fixed the issue immediately with a single ampersand character.

Reasons for deploying a release immediately would be:

  1. The bug is HUGE - completely breaks all panels
  2. Easiest fix, that does actually solve all use-cases (that I've encountered, anyway)
  3. Unless you're specifically thinking ahead about problems that might occur from upgrading PHP versions - IT'S NOT EASY TO PICK UP ON THE REASON AND SEARCH FOR IT. In my case, for instance, my PHP version was automatically updated (using Linux and Update Center did the update for me), so the connection between this and the error was not at all obvious.

I believe this should be released ASAP.

Antonin Brunon’s picture

That bug gave me headache !

Please do poste a new release, I guess we're not 2-3 people facing that issue :)

jhm’s picture

Thank you #4

willbxl’s picture

Thank you very much, I was looking for a solution for weeks!!!

eyenology’s picture

I used the most recent 6.x.3.x-dev install and still needed to patch to work -- but the patch did work succesfully.

markdl58’s picture

Is there an idiots guide to applying a patch on a shared hosting environment?

I've tried editing the panels.module file and adding the &, but I still have no content appearing in Panels. Any help gratefully received as I've been tearing my hair out for the last three days since the host upgraded to PHP5.4!

p4trizio’s picture

#4 works perfecly thank you

ratbagash’s picture

#4 worked a treat - NigelCunningham Nice one ninja

augiem’s picture

This is an absolute CRIME this has not been updated in 2 years! I spent the last 5 hours (and its 5 AM) screaming and banging my head on the wall. (Okay, that's exaggerating, but I was sweating very hard...) I didn't even realize PHP was updated when Apache was rebuilt with EasyApache in WHM, so this was next to impossible to even search on Google for until I traced it to PHP 5.4 by finding unrelated PHP errors in the log from Views, then seeing people got those errors on 5.4, then aha... I knew what to search for. Geez!!!

Every web host is deprecating 5.3 now. Soon there will be hordes of unmaintained sites breaking and nobody will have a clue why.

hansfn’s picture

Yes, it is a crime so I created an issue back in September 2012 requesting a new release: #1774796: Plan for Panels v6.x-3.11 release (PHP 5.4 fix) I even volunteered to make the release ... I think issue 1774796 is the right place to raise your voice as that issue isn't closed.

mr.andrey’s picture

Yep... thanks for the patch in #4.

What I tried to do before I stumbled on the holy grail of that patch:
* Upgraded Pressflow
* Upgraded Panels
* Upgraded Ctools
* Did yoga
* Meditated upon the nature of emotions
* Ate two qusadillas and tried not to think about coding

Who knew that the little squiggly "&" was all it took... such is life.

bib_boy’s picture

Again, had me stumped till I read this. Ampersand fixed it and that is the latest Panels release!

jessehs’s picture

Priority: Major » Critical
Issue tags: +PHP 5.4

Adding "PHP 5.4" tag and upping priority to "critical" since this is a show-stopper for 6.x users.

OliverColeman’s picture

Wasted several hours here, too. I upgraded to latest Ubuntu (Saucy 13.10) which includes PHP 5.4 by default. New release please! :)

pcoucke’s picture

Issue summary: View changes
hansfn’s picture

Issue summary: View changes
hansfn’s picture

Issue summary: View changes
Jamie Holly’s picture

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

Reopening this in hopes that it can get committed. I've tested the patch in #4 and it works great.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 4: panels.module.diff, failed testing.

Funksmaname’s picture

THANKS! The little code change worked for me...

ajayg’s picture

that patch failed because the original file need to be as it is in the source. It has been renamed (the a file) as panels.module.orig which is why the patch failed.

alar’s picture

I'm holding off upgrading a couple of D6 sites. Should I avoid PHP 5.4 if I can?

Funksmaname’s picture

Not for this issue alar (imho), adding the 1 line of code in the first post fixed this particular issue.
If it aint broke though, don't fix it - but you might find your hosts will force you to upgrade php at some point (happened to us on quite a few sites)

c4rl’s picture

Status: Needs work » Closed (duplicate)

Since this has been committed, I'm marking it as a duplicate of #1774796: Plan for Panels v6.x-3.11 release (PHP 5.4 fix)

Let's follow-up there, please. :)

bnadem’s picture

Thank you so mush.
This worked for me as a charm ;)

coreyp_1’s picture

Your "Executive Summary" just saved me *a lot* of time. Thanks!

Status: Closed (duplicate) » Needs review

kaa4ever queued 4: panels.module.diff for re-testing.

Status: Needs review » Needs work

The last submitted patch, 4: panels.module.diff, failed testing.

Wappie08’s picture

Thank you very much for the fix & summary!

ianthomas_uk’s picture

Status: Needs work » Closed (duplicate)

Per #36

MyriamB’s picture

Thank you NigelCunningham for your patch on comment #4. It worked for my sites.

mikekimi’s picture

Awesome stuff...worked for me.

bramvandenbulcke’s picture

Thanks for the executive summary fix!

lunk_rat’s picture

The executive summary was just the medicine I needed for what seemed like a nightmare day of endless troubles ... thanks all!

mellenger’s picture

Executive Summary saved the day. Now I can eat dinner and sleep!