Sorry, we don't support your browser.  Install a modern browser

PHP API: overrule restrictions from blueprint#95

As blueprint options like changeStatus are commonly used to control the Panel UI, it would be good if these could be overruled programmatically - while a developer may not want authors to be able to change a page status, they might want to change it from withing their PHP code.

Copied here from this Gtihub issue https://github.com/getkirby/ideas/issues/171 with more details.

4 years ago
1

I’m all in for that idea, as it woudl align it with the $page->update() method also has a $validate parameter. As a developer, I’m able to put invalid content into any content file from the API by turning off validation, so the same should be possible for the page status as well.

4 years ago
1

The current behavior here seems unexpected and feels like a design flaw/bug.

I opened a question on the forum after not being able to come up with any workaround (https://forum.getkirby.com/t/how-to-disable-changing-page-status-frontend-only-allow-programmatically/26640/2).

Usecase: A collection where all entries should always be published (and should not be changeable to drafts), which is achieved by programmatically changing the status of new entries to listed (“published” on the frontend) when they’re created (via the page.create:after hook).

2 years ago

I don’t know if the simple solution to this give here (https://github.com/getkirby/ideas/issues/171#issuecomment-684939609) would still work or not, but if there’s indeed such a simple solution to this then is there any reason not to do this?

2 years ago