kirby3-autoid
kirby3-autoid copied to clipboard
Duplicating a page with child pages leads to double AutoIDs
When a page is duplicated, the page only updates the AutoID field of the page itself. This leads to duplicate IDs for any duplicated child pages. As far as I understand, this can be fixed by using the page.duplicate:after
hook:
'page.duplicate:after' => function($duplicatePage, $originalPage) {
foreach ($duplicatePage->index(true) as $item) {
\Bnomei\AutoID::push($item, true);
}
},
this should be take care of already. https://github.com/bnomei/kirby3-autoid/blob/dfd33b2caa81f04967a246af636579c08b06913d/index.php#L157
- [x] for now i am fixing the params to
$duplicatePage, $originalPage
. - [x] and force index including drafts