Peter Falkenberg Brown Posted November 26, 2014 Posted November 26, 2014 Hello PW Gurus, I'm stuck on a strange symptom. I've created a routine to edit and update a page of values via a form and the api. Part of that routine is to add and/or delete child pages of a different page branch. When I run through the edit / update and use the code: $pages->delete($domain_ip_former_page_child_page, true); and then further down, do a: $pages->save($page); the currently selected values of the primary page do not get saved. Somewhere between selection of the values and the save command, the $page object loses the selected values. When I comment out the delete command, the primary page saves correctly. Also, the delete command (when used) does successfully delete the child page in question. I get the child page with this code (ignore the line breaks): $domain_ip_former_page_child_page = $pages->get( "parent=$domain_ip_former_page_url, account_id=$account_page_account_id, include=hidden, $skiptrash" ); I just can't figure out why a page delete command would mess with the values of the current $page object. Anyone have any thoughts? Edit: I'm using PW 2.3.0. Thanks, Peter
LostKobrakai Posted November 26, 2014 Posted November 26, 2014 Have you tried this? Maybe it's not the $page object which got messed with. But if you don't override $page or $pages this shouldn't happen. $page->save(); Of topic: Maybe think about updateing pw. The current stable version is 2.5.3, with lots of great new features.
Peter Falkenberg Brown Posted November 27, 2014 Author Posted November 27, 2014 Have you tried this? Maybe it's not the $page object which got messed with. But if you don't override $page or $pages this shouldn't happen. $page->save(); Of topic: Maybe think about updateing pw. The current stable version is 2.5.3, with lots of great new features. Yes, I've tried with $page->save() with the same result. My code to save or delete the other pages is specifically using a different variable for those page objects, so I would think that there shouldn't be any conflict. I wonder, however, if in the internals of PW code there's a variable conflict, i.e. in the processing of the other pages, some code uses the $page object. I can't upgrade with this particular application because of client requirements. Yours, Peter
Soma Posted November 27, 2014 Posted November 27, 2014 Whole code? I could imagine a delete flushes pages cache.. something set to a page object in memory before gets loSt. Pretty sure. Or you delete something that is select.
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