1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 00:06:55 +02:00

Attempt fix for processwire/processwire-issues#1459 and processwire/processwire-issues#1297 by rewriting code that builds pages_parents table and requires fewer changes to the table. This is called on page parent changes and clone operations. Needs further testing on installation with 1+ million pages to compare with previous and confirm performance improvement while maintaining same accuracy.

This commit is contained in:
Ryan Cramer
2023-02-02 13:49:07 -05:00
parent 7997a40e21
commit b74f6ca359
2 changed files with 139 additions and 4 deletions

View File

@@ -1280,11 +1280,13 @@ class PagesEditor extends Wire {
if($options['recursionLevel'] === 0) {
// update pages_parents table, only when at recursionLevel 0 since parents()->rebuild() already descends
/*
if($copy->numChildren) {
$copy->setIsNew(true);
$this->pages->parents()->rebuild($copy);
$copy->setIsNew(false);
}
*/
// update sort
if($copy->parent()->sortfield() == 'sort') {
$this->sortPage($copy, $copy->sort, true);