I was receiving strict warning errors and applied the patch in https://www.drupal.org/node/1988250, which almost solved my problem. However, in cases where we have no view modes panelized (save for Full Page Override), I would get a few errors like "Warning: Creating default object from empty value in PanelizerEntityDefault->hook_entity_update()" ultimately resulting in a PDOException:
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'did' doesn't have a default value: INSERT INTO {panelizer_entity} (entity_type, entity_id, revision_id, view_mode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3)
I attached a patch that addresses this by skipping empty $panelizer variables in hook_entity_update().
I've rolled the attached patch against 7.x-3.1 (the version I'm using), but the issue appears to persist in the dev branch as well. I'm happy to re-roll against 7.x-3.x if you'd like.
Comment | File | Size | Author |
---|---|---|---|
#8 | panelizer-n2675766-8.patch | 1.05 KB | DamienMcKenna |
|
Comments
Comment #2
gustavderdrache CreditAttribution: gustavderdrache commentedUpdate: I forgot about hook_entity_insert().
Comment #3
DamienMcKennaComment #5
DamienMcKennaComment #6
DamienMcKennaComment #8
DamienMcKennaRerolled.
Comment #9
DamienMcKennaI wonder if the changes to hook_entity_update() should delete any matching {panelizer_entity} records? Hrm..
Comment #10
DamienMcKennaThis deletes any {panelizer_entity} records that match the empty view mode for that entity / revision.
Comment #11
DamienMcKennaOh no, I uploaded the wrong patch and then reverted the changes locally. Gah.
Comment #12
DamienMcKennaI was able to recover the lost changes, yay for never closing tabs ;-)
Comment #13
DamienMcKennaLets go with the patch from #8 and punt the cleanup to #2756699: Cleanup data during hook_entity_update() if $entity->panelizer is empty.
Comment #15
DamienMcKennaCommitted. Thanks!