Sinmok Posted November 20, 2014 Share Posted November 20, 2014 Hi all, Trying to create a simple script that iterates over each page and simply calls the save function. I've got a file called saveall.php with the following code: <?php include 'index.php'; function sitemapListPage($page) { $page->save(); if($page->numChildren) { foreach($page->children as $child){ sitemapListPage($child); } } } sitemapListPage(wire("pages")->get("/")); ?> This code sample is adapted from the ProcessWire sitemap plugin, but I've tried other methods and nothing seems to work. I want to call save() as I have a beforeSave hook from a module that I want to run. However for some reason, running this script causes me to get the follow error, on every page: Error: Uncaught exception 'Wire404Exception' with message 'Unknown page' in /var/my_site/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module:59 If I loop through each page and print out the id/title of each page in the loop, they display fine. Any idea what might be causing this? I'm using PW 2.3.0 EDIT: Never mind - figured out the error was coming from the installed module Link to comment Share on other sites More sharing options...
Nico Knoll Posted November 20, 2014 Share Posted November 20, 2014 EDIT: Never mind - figured out the error was coming from the installed module 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