MagickTree messed with my tree and can no longer open it. How do I recover the data?

Error message

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'comment_node_forum_form' not found or invalid function name in drupal_retrieve_form() (line 844 of /var/www/www.gremwell.com/includes/form.inc).

After saving the tree in a file and then trying to open it again, MagickTree fails with the following error message:
Malformed XREF found. The href attribute value does not look like #111 . The value is : #-1
And is not able to load the file. What can be done in order to recover the file? The file format is binary, and I hope I won't have to reverse engineer its structure in order to get my data back.
Thanks.

Forums: 

Files saved by MT are ZIP archives containing XML files.

LOL, how come I didn't execute /usr/bin/file before posting this? Anyway, thanks for the quick answer!

Hi webpentest,

Sorry about it, it's a pain when your data gets corrupted.

Recovering it is possible, although a bit painful too. :(

Unzip the project file. You'll have a content.xml file and possibly several directories with numeric names. Open content.xml in a text editor and search for "#-1". It will be an attribute of an XML tag, most likely of a <method> or a <task>

If it is a task, the easiest way to fix the problem is just to delete the whole task, from opening <task> to closing </task> tag. This way you'll lose the information about the executed command, but if you have imported the XML data it produced, that won't be lost.

Alternatively, you can try to figure out where the href attribute should be pointing and modify the value. Tasks point to methods, and methods point to queries. If you can find the <query> or <method> element it should be pointing to, you can set the value of href attribute to the value of the id attribute of the target query or method, for example href="#123".

Save XML file, zip it along with any folders with numeric names and try opening it with MagicTree.

Now we are over this, I would really like to fix whatever has caused the data corruption. Can you reproduce the sequence of steps that produced the corrupted file?

Alla

Yeah, after I understood about zip, everything else was simple, thanks.
Btw, just cannot understand why keep your solution closed-source? Community-submitted patches and ideas can be a great win for a tool like yours.

Add new comment

CAPTCHA
Please answer the question to prove that you are not a spammer. If it isn't working and you are not a spammer, please email us.
Fill in the blank.