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

Documented instructions for cloning elements out of date #3638

dkidd opened this Issue Nov 21, 2018 · 2 comments


None yet
2 participants

dkidd commented Nov 21, 2018

The documentation for cloning elements (doc/Development_Documentation/18_Tools_and_Features/31_Cloning is out of date. The Service classes have been substantially refactored, and the code examples no longer work.

I'd be happy to suggest revisions, but I'm not sure of the best practice for getting the current admin user.


This comment has been minimized.


weisswurstkanone commented Dec 4, 2018

What exactly is out of date ?


This comment has been minimized.


dkidd commented Dec 4, 2018

Sorry. I should have clarified that. The documentation says:

If you want to get a persistent copy use the copyAsChildmethod of the corresponding service. E.g.

Pimcore\Model\Asset\Service::copyAsChild($target, $source)

where $source is the source element and $target the parent element of the new element. This will also create a unique element key (or filename for asset elements).

Pimcore\Model\Asset\Service::copyAsChild() is no longer a static function. Neither are the equivalent functions for DataObjects and Documents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment