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
Programatically added pages can't be edited in composer #2991
Comments
As I'm going through the code, there's also an undefined variable: https://github.com/concrete5/concrete5/blob/develop/web/concrete/controllers/panel/detail/page/composer.php#L104 |
Calling $parentPage = Page::getByID($masterPageID);
$pageType = PageType::getById($ptID);
$newPage = $parentPage->add($pageType, ['cName' => $pageName, 'cHandle' => $pageName]);
$newPage->movePageDisplayOrderToSibling($insertAfterPage, 'after');
// make sure we can properly edit out embedded blocks
$pageType->savePageTypeComposerForm($newPage);
$pageType->publish($newPage);
// set name again, saving from composer seems to clear the name
$newPage->update(['cName' => $pageName]); |
Sorry for the late comment. If you try to fix this nice way, you should also consider page duplicate I've had a work around like this. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions! |
Removing labels since I believe this has since been fixed. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions! |
Page->add(..)
according to https://www.concrete5.org/documentation/developers/5.7/working-with-pages/working-with-pages-programmatically/It works well if I create the page using the composer, only when I do that programmatically it fails.
The text was updated successfully, but these errors were encountered: