ryancramerdesign / ProcessWire

Our repository has moved to https://github.com/processwire – please head there for the latest version.
https://processwire.com
Other
727 stars 201 forks source link

Unneeded update on page save with "parent" changed #2061

Closed Zarik closed 7 years ago

Zarik commented 7 years ago

Recently we've encountered an issue with page save with "parent" field changed. https://processwire.com/talk/topic/15740-problem-with-page-parent-change-in-admin-tree/

The issue seemed to occur somewhere in the core where we failed to debug it. However during numerous debug and run tests it was discovered that the save operation did not stuck -- it just took 32 minutes to perform "pages_parents" update on the whole (admin branch) page tree.

In the PagesEditor.php line 736 the code call to update all siblings of the new "parent page". I think there is no need to update them -- nothing changed for these pages.

In addition, if you just change a little bit the saveParents() function and remove unneeded $numChildren parameter and always update a current page and all its children -- this will be enough, IMHO.

Zarik commented 7 years ago

Sorry, used a wrong repo. Reposted this issue in the correct one: https://github.com/processwire/processwire-issues/issues/220