bramwolf Posted August 31, 2015 Share Posted August 31, 2015 Hey Guys, I've been trying to load a field from a different page, update it's value and save it. that's all,... and i CANT get it to work! Extremely frustrating < $bestelnummer = $fields->get('bestelnummer'); $bestelnummer++; $fields->save($bestelnummer); echo $bestelnummer; Can someone please help this poor little retarded boy out? Thanks guys! Link to comment Share on other sites More sharing options...
diogo Posted August 31, 2015 Share Posted August 31, 2015 You are getting the general field itself, not the field in that page. Try this instead: $other_page = $pages->get("selector_for_the_page"); $other_page->setOutputFormatting(false); $other_page->bestelnummer = $other_page->bestelnummer++; $other_page->save('bestelnummer'); To understand the second line check this: http://cheatsheet.processwire.com/page/built-in-methods-reference/page-setoutputformatting-true-false/ 3 Link to comment Share on other sites More sharing options...
bramwolf Posted August 31, 2015 Author Share Posted August 31, 2015 Ah yes!! Thank you Very much I Tried maybe 15 different things next to my code at the top here, But I never applied OutputFormatting, so i kept getting the error. Thanks! 1 Link to comment Share on other sites More sharing options...
diogo Posted August 31, 2015 Share Posted August 31, 2015 You have to read the errors Link to comment Share on other sites More sharing options...
bramwolf Posted August 31, 2015 Author Share Posted August 31, 2015 Uh, where? I only got a Internal server error displayed in my browser, nothing in the console? Link to comment Share on other sites More sharing options...
diogo Posted August 31, 2015 Share Posted August 31, 2015 You have to be logged in to read the errors. Link to comment Share on other sites More sharing options...
bramwolf Posted August 31, 2015 Author Share Posted August 31, 2015 I was? I never saw anything that pointed me towards this problem? Is there some specific place I should look for the error? Since i only thing I recall is seeing "The error had been logged because you are logged in as administrator" a few times, but never a specific error other than Internal server error.. Link to comment Share on other sites More sharing options...
LostKobrakai Posted August 31, 2015 Share Posted August 31, 2015 You can enable debug mode in the site/config.php to get more information on errors. 1 Link to comment Share on other sites More sharing options...
bramwolf Posted August 31, 2015 Author Share Posted August 31, 2015 AHA! Thanx man, i did not know that! Maybe it's time to actually read all the docs {:} thanks Link to comment Share on other sites More sharing options...
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