I am (enthusiastically) using Panelizer, because it is the ultimate in detailed styling and structuring of individual nodes.
I'm using Drupal 7.21, Panelizer 7.x.3.1. The panelizing itself appears to be working well. When I edit a panelized node, however, I get this "red warning":
Strict warning: Creating default object from empty value in PanelizerEntityDefault->hook_field_attach_submit() (line 1113 of E:\xampp\htdocs\dru721\sites\all\modules\panelizer\plugins\entity\PanelizerEntityDefault.class.php).
I can edit my text, and I can save it, and the panelizing is working. Only thing: this message is there. On the Drupal forums, something similar is mentioned, but with other modules (e.g. drupal.org/node/1863618 , 1242362, 1065270, 1148724 etc.). So, I think it's kind of a known problem, which, according to these messages, should be solvable - hopefully also in Panelizer...
Comments
Comment #1
modul commentedJust wanted to add that the exact same error message also appears when I add a new node. This new node has not been panelized. It appears twice - maybe because I have Panelizer switched on for "Full content" and for "Teaser"? Just wild guessing.
Ah, something else shows up now: originally (in my first posting), I only had one "panelizing" instance active (i.e. "Full content"). Then, I added "Teaser". When I have both "panelizations" done, so for the full content as well as for the teaser, and when I then edit my node text, the "red message" does not appear.
I think - but I'm not sure - that I have been messing with "Teaser" panelizing on and then off again. Just trying to describe what happens. Difficult :-). Hopefully, correcting it or at least indicating a way how to get rid of the red message, will prove easier.
Comment #2
modul commentedAny news on this matter? I should look into it a bit more carefully, but on another D7 installation I have all panelizing options available (Full Text, Teaser, RSS etc.), and I think the error does not occur there - but I'm not sure. Just mentioning this as a possible clue for the wizards.
Comment #3
merlinofchaos commentedAhh, I think that's a bug in that it's trying to add properties to a panelizer default when there isn't one.
Please note that the error message you see in other issues happen in different pieces of code, so just because they're the same error message doesn't mean they're related at all. The location of the error is more important when determining if an error is the same or not.
The attached patch should fix the warning.
As a workaround, in your Drupal's system configuration, you can change the location where PHP errors are reported so that the red warning will appear only in your logs, not to your users.
Comment #4
modul commentedHi Merlin. Feels a bit strange to talk to The Master himself :-)
I applied your patch, then tried to edit-and-save a node (without panelizing, but with "Full Content" and "Teaser" available). This was the result:
And my screen was frozen :-) . I hope this makes sense to you...?
Comment #5
merlinofchaos commentedWow, total fail in that patch. I'll have to look more deeply at this when I have more time.
Comment #6
modul commentedHi Merlin, thanks for wanting to take care of this issue.
Comment #7
modul commentedHi Merlin, just wanted to let you know that my "Strict Warning" problem is solved. In admin/config/content/panelizer I had only marked "Panelize" and "Allow Panel Choice", so not "Provide Default Panel". Now I have marked "Provide Default Panel" too, and the problem is gone. Still, it would be nice that beotians like me would not be freaked out by "Strict Warnings" :-) . Anyway, my little problem is solved now. Take your time in adding something to your code to prevent that warning from appearing - or maybe turn it into a less alarming drupal_set_message or something. Good luck and lots of inspiration in your current and future contributions to the Drupal community!
Comment #8
merlinofchaos commentedThat's what we call a workaround -- it gets rid of the problem, but it isn't really a solution. It's good to know that's where it's coming from, though. It gives me a good idea of what to do to reproduce it. Hm. That sounds familiar, too, so there may be another issue with that already.
Comment #9
damienmckenna@merlin: Did you ever identify the other issue you thought this was related to?
Comment #10
damienmckennaComment #11
damienmckennaComment #12
damienmckennaComment #13
damienmckennaCommitted.
Comment #16
xaa commentedhello,
I am wondering if there is any progress on this issue ? For now we have a workaround (check "Provide Default Panel") but the issue is still on the table . Furthermore it sounds like a real issue for new user trying to use the module.
My use case:
Using node template from themes. Need panelizer activated on few nodes only.
I have the error after save/update nodes that have panelizer disable. So I have the error on 90% of the nodes..
In many cases we really don't need to activate "provide default panel". If there is the option in the backend we should be able to choice. For now it's not possible.
The patch suggested here seems fix the error but then other errors happens (see #4).
I am missing somtheing ? Thank you
Comment #17
damienmckenna@xaa: Please open a new issue and I'll see what I can do to help.
Comment #18
kkumaren commentedI'm having the same issue as xaa, where all my node are generated from panels using different variations except some of them which are panelized. Did anyone have a solution for this issue?