We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42701
    • 47 Posts
    I have a client who saves a ton of deleted resources on their ModX install. Today I noticed they were gone. I've done a fairly recent upgrade to 2.3.3. Is it possible that the upgrade permanently erased the deleted resources? Are there any tips, suggestions for troubleshooting or solving this problem? I'm at the point where I am ready to roll back changes, but unfortunately the most recent backups are several months ago.

    This question has been answered by multiple community members. See the first response.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Is it possible that somebody else emptied the trash? All it takes is one click on the trash can icon.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Actually you should be able to look in the Resports -> Manager Actions to see if that's what happened.

        Hmmm... just checked on that, and apparently the "empty trash" action isn't logged.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
        • discuss.answer
          • 3749
          • 24,544 Posts
          This is not very likely, but it's worth checking. It's possible that the resources are still there but not showing in the tree. A look in the modx_site_content table in the database will tell you. If they're still there, they'll have a 1 in the deleted field (and may have a 0 in the show_in_tree field).
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
          • discuss.answer
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            No, emptying the trash is definitely not logged. It's a simple one-line addition to emptyrecyclebin.class.php though, around line 59
            $this->modx->logManagerAction('Empty Trash','modResource','Trash');
            
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 3749
              • 24,544 Posts
              Quote from: sottwell at May 22, 2015, 11:23 PM
              No, emptying the trash is definitely not logged. It's a simple one-line addition to emptyrecyclebin.class.php though, around line 59
              $this->modx->logManagerAction('Empty Trash','modResource','Trash');
              

              That does that log the culprit's ID, right?
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                That logs his username and the date/time of the action. I've actually made a pull request to get that added to the 2.4.0-dev, so if they accept it it will become part of the core.

                In the meantime, it might be safer to use the same function in a plugin.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 42701
                  • 47 Posts
                  Thanks Guys,

                  I took a look at the site_content table, but there were no records with show_in_tree set to 0. I was able to update the sql files though and rescue about 100 resources. Sotwell, I think I will add that plugin to my sites as it will no doubt be quite useful in the future. Thanks for your help!