wilsea Posted July 11, 2014 Share Posted July 11, 2014 I'm trying to update a number of pages with the following code $levels = $pages->find("template=level"); echo "Changing ". count($levels). " levels"; foreach($levels as $lev){ $lev->setOutputFormatting(false); $lev->user_id = 4233; $lev->save; } The message shows the correct number of levels, so the code is being run, but the pages are not changed. It's probably something trivial, but I can't figure our what I'm missing. Can someone put me on the right track? Link to comment Share on other sites More sharing options...
arjen Posted July 11, 2014 Share Posted July 11, 2014 Try: $lev->save(); 1 Link to comment Share on other sites More sharing options...
wilsea Posted July 11, 2014 Author Share Posted July 11, 2014 Thanks arjen - can't believe how long I looked at the code without noticing the missing () . Knew it had to be something obvious but still couldn't see it. 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