Ahh, I see now. Let me check the issue.
Iāve found the issue. Iāll fix the issue in next release. Thanks for help.
Version 2.3.0
Fixes
- Hook argument issue fixed with cloning fix
Breaking Changes
- Dropped PHP 7.4 support
Thanks @ahmetbora for the pluginās new version butā¦ It doesnāt work yet.
[...]
'page.move:after' => function (Kirby\Cms\Page $newPage, Kirby\Cms\Page $oldPage, ?Kirby\Cms\Page $parent = null)
{
Db::update('Pages', ['pagePath' => $newPage->uri()], ['pageAutoID' => $newPage->pageAutoID()]);
file_put_contents('page.move.after.log', $newPage->uri().'|'.$oldPage->pageAutoID() . PHP_EOL . PHP_EOL, FILE_APPEND);
},
$oldPage->pageAutoID()
(but $newPage->pageAutoID()
as well) are null (see the screenshot after the pipe)
ā¦Let me add one (strange) thing: I found moved pages are quite slower to load than other pages. I donāt have data to prove what Iām saying, and I donāt know how to track the page loading time in a simple way. I wonder if the old URI is cached somewhere (even if I deleted the cache folder), orā¦ Donāt know.
Where the pageAutoID
comes from? From content file, model or custom page method?
content file
I think Iāve fixed the issue in last release as 2.3.1. Could you test it, please?
Ok, now it seems to work! Thank you!
Thank you so much for reporting and testing
ā¦Let me add one (strange) thing: I found moved pages are quite slower to load than other pages. I donāt have data to prove what Iām saying, and I donāt know how to track the page loading time in a simple way. I wonder if the old URI is cached somewhere (even if I deleted the cache folder), orā¦ Donāt know.
This may be because if there are images on the page, images are processing (thumbs in media directory) for the new path for the first time.
Hm, canāt get the query language to work with the plugin. When I use
options:
move:
- templateName
this works fine, except I want the order reversed which would be something like:
options:
move:
- site.children.filterBy('template', 'issue').sortBy('title', 'desc')
but even site.children
or kirby.page('archive').children
(found here) does not return anything in the panel options. Any idea what the problem could be?
Using Kirby 3.9.1, MovePages 2.3.1 on PHP 8.1.14.
Try like that
options:
move: site.children.filterBy('template', 'issue').sortBy('title', 'desc')
Donāt forget! To move a page under the another page, the parent page must support the page template you are moving. This option must be a query language string or an array of templates and must be a collection of pages, not a single page.
Oh, interesting and thanks for the hint! Why does it work when not using the yaml list? This implies that I have to either choose KQL or the list feature but cannot combine both, right?
Exactly!
One more thing unrelated to the previous issue: Would it be possible or do you plan to add support for moving multiple pages to a new destination?
Not in our agenda but Iāll note this idea our list.