Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated page seems not properly indexed when page.duplicate:after hook is triggered #1923

Closed
qwerdee opened this issue Jul 15, 2019 · 2 comments

Comments

@qwerdee
Copy link

commented Jul 15, 2019

Describe the bug
When duplicating a page through the panel, the newly created copy seems not to be added to the internal index. This causes problems in the page.duplicate:after hook.

'page.duplicate:after' => function (Page $page) {
    // evaluates to null
    $this->site()->findPageOrDraft($page->id()); 

    // doesn't list $page and its subpages
    $this->site()->index(true)
}

Expected behavior
The new page should be indexed correctly before page.duplicate:after hook is triggered.

Kirby Version
3.2.2

@qwerdee

This comment has been minimized.

Copy link
Author

commented Jul 15, 2019

I wanted to update the content of pages fields to change references to child pages to the duplicated child pages, e.g. original/some-child to original-copy/some-child. Currently that is not working in the page.duplicate:after hook and my guess is, that kirby prevents you from updating pages fields with ids that are not indexed(?)

@bastianallgeier

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.