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

setAndSave() issue with saving page status #1806

Closed
LostKobrakai opened this issue May 2, 2016 · 1 comment
Closed

setAndSave() issue with saving page status #1806

LostKobrakai opened this issue May 2, 2016 · 1 comment
Labels

Comments

@LostKobrakai
Copy link

I was using this code, which doesn't work anymore on 3.0.15

$page->setAndSave('status', Page::statusUnpublished);

I also tried

$page->of(false);
$page->addStatus(Page::statusUnpublished);
$page->save('status');

I only started working as soon as I removed the 'status' argument in the save method.

@ryancramerdesign
Copy link
Owner

The setAndSave() actually can't be used with properties native to the pages table because those properties are only saved with the page as a whole. Meaning, setAndSave() is purely about saving page fields, not native properties. Though I would like to abstract that further so one doesn't have to think about that. But in order to make it worthwhile, $pages->saveField() would need to support them as well, and basically we'd need a whole new $pages->saveProperty() method, since there isn't currently a way to save properties independent of the page as a whole. ...So yeah I think we can support this, but it's not a quick fix. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants