Soma Posted December 5, 2013 Posted December 5, 2013 I seen this a couple times here by Ryan but can't find it. There a method to save a page silently so it doesn't update modified or user when saving a page. Was it $page->save(false) ? Anyone remember?
Martijn Geerts Posted December 5, 2013 Posted December 5, 2013 I'm not shure but it was something like: $pages->save($page, array('quiet' => true)); 4
Soma Posted December 5, 2013 Author Posted December 5, 2013 Yeah I think that was it. Just tested and seems to work. Thanks!
ryan Posted December 5, 2013 Posted December 5, 2013 These should also work (on dev): // save directly from page object $page->save(array('quiet' => true)); // save just 1 field from page object $page->save('myfield', array('quiet' => true)); When quiet mode is set, the modified date is set to whatever is specified in the page. Meaning, the modified date is not updated unless you change it yourself. Quiet mode also lets you modify the modifedUser and createdUser for the page, if you want to. These are two properties you can't usually modify, but quiet mode lets you do it. 10
gebeer Posted December 30, 2015 Posted December 30, 2015 Great to have that options array for the save method. I just discovered this when trying to set the modifiedUser of a page. Had to do a google search and read some forum posts until I finally found it here. Would be really great, if this was mentioned in the cheat sheet for http://cheatsheet.processwire.com/pages/built-in-methods-reference/pages-save-page/ , http://cheatsheet.processwire.com/page/built-in-methods-reference/page-save/ and http://cheatsheet.processwire.com/page/built-in-methods-reference/page-save-field/
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now