It seems to me that resetting an entity's display to the defaults is as much an "update" to the entity as any other panelizer edits. I suggest we re-save the entity. I'm specifically interested in this as it will allow Entity Cache to play nicely with the reset button.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | panelizer-n2082841-16.patch | 671 bytes | damienmckenna |
Comments
Comment #1
azinck commentedComment #2
damienmckennaI'd like to get merlinofchaos' opinion on this.
Comment #3
damienmckennaComment #4
damienmckennaComment #5
damienmckennaComment #6
damienmckennaLets get the patch reviewed.
Comment #7
damienmckennaRerolled because of #2218275: 'Reset' should not delete all {panelizer_entity} records for the entity.
Comment #8
damienmckennaStrictly speaking this then means that the caches don't have to be manually purged.
Comment #11
damienmckenna8: panelizer-n2082841-8.patch queued for re-testing.
Comment #12
mglamanIs there more steps to reproduce, test this? I ran through xdebug and could never get
page_resetto run, which leads to executing$this->reset_entity_panelizer($entity, $view_mode);.However, I did xdebug on Entity Cache and
entitycache_entity_update()seems to get called whenever Panelizer settings (custom settings, content, etc) are updated.Comment #15
damienmckennaComment #16
damienmckennaRerolled.
FYI I also created #2409373: "Reset to defaults" should work with revisions as I realized that revisions were not being handled correctly.
Comment #17
damienmckennaComment #18
mglamanAgain, I think this is working as expected. This patch is within delete_entity_panelizer() method.
I tried to find usages of this method, and this is the only time it is used - the hook_entity_delete() method. It doesn't seem to hurt anything by trying to save the entity, however resetting caches seems less harmful then attempting to save the entity.
Resetting a view mode invokes reset_entity_panelizer().
And this does invoke an entity save. Both methods delete items from the panelizer_entity table and remove entries. Except the reset is working as designed, and as requested in the issue.
Comment #19
damienmckennaComment #20
damienmckennaShould it also remove the $entity->panelizer records?
Comment #21
socialnicheguru commentedThis caused smart_ip module not to work. With this patch enabled going to admin/config/people/smart_ip caused WSOD and a segmentation fault. https://www.drupal.org/node/2798325
this was on a clean install