Tidy script destroyed all my content

Hi,


today I tried the tidy script which is supposed to go through all the content divs. After running the script, which posted a lot of error messages I got a bad feeling.



So I checked the front end. All content divs had gone. I logged into back-end and the content where gone even there.



So I did a recover from a backup. Now the content is back. But I get error messages telling for every hrefs to assets within the content div. As an example, every img tags are generating a error message like this:

    PHP Notice
File: [SYSTEM_ROOT]/data/private/assets/bodycopy_div/86/content_file.php Line: 5
Message: Undefined offset: 281
Backtrace: Show




When checking out the content file, it seems like that instead of the
    ./?a=xxx
that I've typed for every img, link and so on it has been replaced to this:
    <?php echo $sq_asset_url_list[xxx]; ?>
the "new" asset number (xxx) is the same as before. So I was thinking about to search and replace every asset for with this match.



Does anybody have experience in this, and how can I get my original working content back?!

That's correct – the <?php … ?> code is replaced by Matrix on the front-end with the correct URL for the asset. This is how Matrix maintains the URLs when you move content around in your Matrix system.


The error you're getting usually suggests that Matrix cannot find an asset with that ID in the system. I'm not sure why Tidy would've removed any content (I've never seen that happen before). Could you post the errors you got, by any chance?

Another thing that may have happened is that you have lost the notice links between content items. This happens when content is removed, but restoring from backup would have restored them as well.


Try running the system_integrity_content_links.php script in the MYSOURCE_ROOT/scripts directory. This script will regenerate all the cached PHP content files and recreate the links (if they are missing).


    php MYSOURCE_ROOT/scripts/system_integrity_content_links.php /path/to/matrix

This is a clip from error.log:

    [2005-11-07 21:49:46][7:Public User][8:php notice][R] (/data/private/assets/bodycopy_div/86/content_file.php:5) - Undefined offset:  281
    [2005-11-07 21:49:46][7:Public User][8:php notice][R] (/data/private/assets/bodycopy_div/86/content_file.php:5) - Undefined offset:  288
    [2005-11-07 21:49:46][7:Public User][8:php notice][R] (/data/private/assets/bodycopy_div/86/content_file.php:6) - Undefined offset:  293
    [2005-11-07 21:49:46][7:Public User][8:php notice][R] (/data/private/assets/bodycopy_div/86/content_file.php:7) - Undefined offset:  303
    [2005-11-07 21:49:46][7:Public User][8:php notice][R] (/data/private/assets/bodycopy_div/86/content_file.php:8) - Undefined offset:  315
    [2005-11-07 21:49:46][7:Public User][8:php notice][R] (/data/private/assets/bodycopy_div/86/content_file.php:9) - Undefined offset:  326


And this is a clip from the bodycopy_div/86/content_file.php (row 5):
    
  • > nordisk mat
    • >Om nordisk mat

      I have to reminder of that I cant see any content in the backed. Can it have to do with same PHP error?
  • [quote]Another thing that may have happened is that you have lost the notice links between content items. This happens when content is removed, but restoring from backup would have restored them as well.


    Try running the system_integrity_content_links.php script in the MYSOURCE_ROOT/scripts directory. This script will regenerate all the cached PHP content files and recreate the links (if they are missing).


        php MYSOURCE_ROOT/scripts/system_integrity_content_links.php /path/to/matrix

    [right][post=“7444”]<{POST_SNAPBACK}>[/post][/right][/quote]



    Greg: Ran this script right now. The result was the same as after running the tidy script. All content within the div’s has dissapeard again! When I visit the front-end the pages are showing the design without any content. (Without errors :slight_smile: )



    Now I have to restore again… or do u have any other tips?

    Just made the restore this time I also made a restore of the DB which seems to helpt me out!




    Thank god!