getkirby-v2 / panel

This is the deprecated admin panel for Kirby v2.
http://getkirby.com
Other
133 stars 71 forks source link

Split panel.page.update into two hooks #1110

Closed jenstornell closed 3 years ago

jenstornell commented 6 years ago

When changing the template the panel, panel.page.update is triggered. While it seems correct at first, it has a pitfall.

panel.page.update is trigged both when the content inside a file has changed and when the file is renamed. This is two different operations. It require some extra work for a plugin developer like me to figure if the panel user updated the content or changed the template.

https://forum.getkirby.com/t/panel-templatechange-hook/8746

If we still want to keep panel.page.update for backward compability, we can just add two new hooks, panel.page.template and panel.page.save.

I think it should be one hook for one task.