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

Programatically added pages can't be edited in composer #2991

Closed
Remo opened this issue Sep 21, 2015 · 6 comments
Closed

Programatically added pages can't be edited in composer #2991

Remo opened this issue Sep 21, 2015 · 6 comments
Labels
Stale Issues that have been inactive for more than 180 days and will soon be closed

Comments

@Remo
Copy link
Contributor

Remo commented Sep 21, 2015

image

It works well if I create the page using the composer, only when I do that programmatically it fails.

@Remo
Copy link
Contributor Author

Remo commented Sep 21, 2015

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

@Remo
Copy link
Contributor Author

Remo commented Sep 21, 2015

Calling savePageTypeComposerForm and then publish seems to fix the problem. It's not exactly nice and certainly just a stupid work around:

$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]);

@katzueno
Copy link
Contributor

katzueno commented Nov 9, 2015

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.
#2595

@aembler aembler added Type:Enhancement A need for something new. Status:On Hold For one reason or another, all work on this should stop. Status:Available Reviewed issue, it’s real, we’d review a pull request. and removed status:under discussion Status:On Hold For one reason or another, all work on this should stop. labels Dec 22, 2015
@stale
Copy link

stale bot commented Jan 14, 2020

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!

@stale stale bot added the Stale Issues that have been inactive for more than 180 days and will soon be closed label Jan 14, 2020
@KorvinSzanto KorvinSzanto removed the Stale Issues that have been inactive for more than 180 days and will soon be closed label Jan 14, 2020
@aembler aembler removed Type:Enhancement A need for something new. Status:Available Reviewed issue, it’s real, we’d review a pull request. labels Jun 23, 2022
@aembler
Copy link
Member

aembler commented Jun 23, 2022

Removing labels since I believe this has since been fixed.

@stale
Copy link

stale bot commented Jan 7, 2023

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!

@stale stale bot added the Stale Issues that have been inactive for more than 180 days and will soon be closed label Jan 7, 2023
@stale stale bot closed this as completed Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Issues that have been inactive for more than 180 days and will soon be closed
Projects
None yet
Development

No branches or pull requests

4 participants