Jump to content


Submitter

SUPPORT TOPIC File Information

  • Submitted: Apr 22 2010 10:20 PM
  • Last Updated: Apr 22 2010 10:20 PM
  • File Size: 4.14K
  • Views: 834
  • Downloads: 129
  • Approved by: Dean
  • Approved on: 27 April 2010 - 02:15 PM

Download mv_findorphans

- - - - -



Snippet name: mv_findorphans
Snippet description: Finds and reattachs orphaned pages
Revision: 1.0
Date: 2010-04-03
by Mario A. Valdez-Ramirez

With Etomite 1.1 you can accidentally detach a branch (subtree) from the document tree by setting a descendant page as the parent of the current page. Common symptoms of this problem are disappearing pages (they no longer appears in the menus or in the Etomite manager), frozen sites (they take several seconds or even minutes to load and finally only display a "Fatal error: Allowed memory size of XXXXX bytes exhausted" message or a "Fatal error: maximum execution time of XXXX seconds exceeded").

Add this snippet to any page (to a test page not listed in the site), with [!mv_findorphans!], then load the page, click the search button, select what orphan pages to reattach to the test page, and then click the attach button.

You should reattach only the pages that look like the main document for each orphaned subtree. For example, if the documents are: 5->20, 6->20, 7->20, 20->21, 21->22, 22->5, then it looks like the root of the orphaned tree was 22, so that is the only node you should reattach (the other pages in the subtree are already attached to the document 22). When finished, remove the snippet (or unpublish the page), as its security has not been fully tested.

This snippet has been tested with orphaned pages created while editing pages in Etomite 1.1. It has not been tested with corrupted page trees created by database server crashes or manual manipulation. This snippet assumes that the orphaned subtrees are caused by simple circular references (a page having a descendant as parent) and that there is at least one page attached to the root (with parent 0).






  • 248 Total Files
  • 19 Total Categories
  • 50 Total Authors
  • 130,606 Total Downloads
  • TripTracker Gallery Latest File
  • Dean Latest Submitter