Actual version: 7.x-2.0+17-dev
This is part of the Panopoly distribution
Enabled blog module
Go to admin/config/content/panelizer
Set blog to "panelize" and "allow panel choice"
enable the blog user view in /admin/structure/pages
Attempt to create a blog post.
Watch as it throws up all over itself with these notices:
Warning: Attempt to assign property of non-object in PanelizerEntityDefault->hook_entity_insert() (line 775 of /var/www/esmerel/panopolynodemo/profiles/panopoly/modules/contrib/panelizer/plugins/entity/PanelizerEntityDefault.class.php).
Warning: Attempt to assign property of non-object in PanelizerEntityDefault->hook_entity_insert() (line 776 of /var/www/esmerel/panopolynodemo/profiles/panopoly/modules/contrib/panelizer/plugins/entity/PanelizerEntityDefault.class.php).
Warning: Attempt to assign property of non-object in PanelizerEntityDefault->hook_entity_insert() (line 777 of /var/www/esmerel/panopolynodemo/profiles/panopoly/modules/contrib/panelizer/plugins/entity/PanelizerEntityDefault.class.php).
Warning: Attempt to assign property of non-object in PanelizerEntityDefault->hook_entity_insert() (line 780 of /var/www/esmerel/panopolynodemo/profiles/panopoly/modules/contrib/panelizer/plugins/entity/PanelizerEntityDefault.class.php).
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'entity_type' doesn't have a default value: INSERT INTO {panelizer_entity} (name) VALUES (:db_insert_placeholder_0); Array ( [:db_insert_placeholder_0] => ) in drupal_write_record() (line 7013 of /var/www/esmerel/panopolynodemo/includes/common.inc).
Go back to admin/config/content/panelizer/node/blog/list and add a panel configuration.
Everything works perfectly.
Now, if you disable that panel configuration, everything dies again.
Also, if you there's no configuration created under /node/blog/list, on the create content page under "Panelizer" it will say "not panelized" and there are no choices in the 'panel' dropdown.
Comment | File | Size | Author |
---|---|---|---|
#26 | array-to-object-on-update-1623536-26.patch | 1.05 KB | artematem |
#18 | panelizer-n1623536-18.patch | 1.05 KB | DamienMcKenna |
Comments
Comment #1
esmerel CreditAttribution: esmerel commentedUpdating title, because hey, having a title that makes sense is good.
Comment #2
esmerel CreditAttribution: esmerel commentedTried this out with beta 4. It looks like view modes reworked whatever was causing this, because it's not happening now.
Comment #4
adamdicarlo CreditAttribution: adamdicarlo commentedI'm getting this whenever I try to save the Panelizer configuration page (admin/config/content/panelizer) or even when I try to do a feature export/recreate through Drush. Even if it's not for a feature with any panelizer configuration exported.
This started quite soon after turning off the
"Provide default"Allow panel choice option on all of my panelized content types.Versions:
Comment #5
adamdicarlo CreditAttribution: adamdicarlo commentedJust realized OP was panelizing Blog nodes and I'm panelizing Poll nodes. Both content types implemented by core with hook_node_info(). Coincidence?
Comment #6
adamdicarlo CreditAttribution: adamdicarlo commentedThis doesn't happen when I turn off the UUID module. (I'm not using Panopoly but I am/was using UUID & Deploy.)
In fact, the function in Panelizer that's crashing (PanelizerEntityDefault::hook_entity_update()) doesn't even get called when saving this form when UUID's turned off. (uh... whah?)
When UUID *is* on, $entity->panelizer is an array rather than an object and looks to me like it's missing a bunch of data.
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedHm. I wonder if UUID is calling entity_save() with a fake entity. If that's the case, that could make panelizer *very* unhappy.
Comment #8
Sergii CreditAttribution: Sergii commentedThe problem was it the way uuid stores data: Panelizer and Ctools display objectes become an array.
I created the integration between Panelizer and UUID export to features functionality.
Comment #9
merlinofchaos CreditAttribution: merlinofchaos commentedWow, is that really the right way to do this? This seems completely insane to me. :(
Comment #10
adamdicarlo CreditAttribution: adamdicarlo commentedWondering if I'm following merlin's train of thought and what's going on here. I take it:
I'll admit I'm pretty baffled now -- how was I able to export the panelized nodes in the first place...?
Comment #11
DamienMcKennaThis needs to be rerolled for v3.
Comment #12
DamienMcKennaComment #13
DamienMcKennaComment #14
mukhsim CreditAttribution: mukhsim commentedComment #15
mukhsim CreditAttribution: mukhsim commentedComment #16
DamienMcKennaI was able to reproduce the problem when UUID was disabled (it was enabled first, the error shows, then I disabled UUID, reran test).
In my scenario the error happens when saving a (gallery_photo) node that was added to another (gallery) node via inline_entity_form, and the Panelizer options were not displayed on the form (#2163045: Add integration for inline_entity_form). Furthermore, in this case there were two view modes configured for the gallery_photo content type - page_manager and a custom view mode called "gallery_item". When hook_entity_insert() is triggered in PanelizerEntityDefault and runs the for() loop, the first view mode has a proper $panelizer object, the second view mode just contains the name of the selected panelizer display, not a Panelizer object.
I'll continue on this later.
Comment #17
DamienMcKennaWhat I realized was that, in certain circumstances, the hook_field_attach_submit() call wasn't happening before hook_entity_save(), so the $panelizer values in the hook_entity_save() foreach() loop ended up being arrays with the 'name' value, so I changed it to load the Panelizer object instead.
This could use some testing, but it seems to have resolved the problem for my use case.
Comment #18
DamienMcKennaSmall improvement for the if() statement.
Comment #19
DamienMcKennaCommitted.
Comment #21
MiroslavBanov CreditAttribution: MiroslavBanov commentedThis still happens for me, when I use i18n_panels + panelizer and I configure "Panelizer: Allow panel choice" to be on. This happens even if there is only one panel choice - the "default".
When I delete a node, I get one error and one warning (see attached image):
I tried the latest versions of panelizer and panels, still getting the error.
Comment #22
DamienMcKennaIt seems like this problem is entirely because of #2192355: Undefined panels display::UUID in i18n_panels periodic error. Did you try the patch from that issue?
Comment #23
MiroslavBanov CreditAttribution: MiroslavBanov commentedI did apply the patch. It is not fixing the other issue that with the
I thought this was caused by some a more fundamental problem. I notice that the same issue happens when there is no "Allow panel choice", and the panelizer in Default state. On node updete a panelizer_entity is written to the database, even though the panelizer is still in Default state. Then on node delete, I see the warning.
I think the real problem is that a panelizer_entity is being created, even though the node Panelizer is in Default state. Please correct me, if I am wrong.
Comment #24
MiroslavBanov CreditAttribution: MiroslavBanov commentedI think I understand the problem I had. When the panelized node in Default state is deleted, in PanelizerEntityDefault::delete_entity_panelizer,
SELECT did FROM {panelizer_entity}
returns '0', then panels_delete_display(0) causes both errors. Adding an array_filter removes the zeros.
Comment #25
DamienMcKennaBecause this new bug has nothing to do with the original request, I've moved it into a separate issue: #2235537: Error when deleting a panelized entity
Comment #26
artematem CreditAttribution: artematem commentedApplying same approach as in #18 patch to hook_entity_update to avoid errors like
Warning: Attempt to assign property of non-object in PanelizerEntityDefault->hook_entity_update() (...
Comment #27
DamienMcKennaThanks Artem! The patch has been committed.