We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47589
    • 6 Posts
    Hey everyone,

    Since upgrading to 2.7.0 I've not been able to purge deleted resources.

    I'm directed to an 'An error occurred...' page with the message access denied. Looks like the new trash manager feature isn't working.

    I'm running php7.

    There's nothing in the error log.

    Has anyone else come across this?

    It's obviously not imperative but can anyone through any light on it?
      • 3749
      • 24,544 Posts
      I've had this, but only with specific resources. Most resources were purged as expected but occasionally one would refuse to go away. I couldn't see any reason for it in the resource itself, so I'm suspecting that it has something to do with related objects of resources -- maybe SymLinks or WebLinks that point to the resource.
        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
        • 47589
        • 6 Posts
        Hey Bob,

        I hope you're well.

        Thanks for your input. I've upgraded 3 separate sites in the last month and the trash manager on one of the three works. I've got no symlinks or weblinks setup on any of them but I'll try and figure out what the difference is between them. I'll report back if I work it out as it may help someone else in the same situation.

        Thanks,

        Adam


          • 3749
          • 24,544 Posts
          It's probably worth checking the date_timezone System Setting to see if it matches the server and PHP settings.

            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
            • 46584
            • 29 Posts
            I'm getting the same error when trying to clear the trash
            An error occurred...
            Access denied.

            If I set my user account to sudo, then this fixes the problem, so it must be a permissions issue somewhere?
              • 3749
              • 24,544 Posts
              If you've upgraded MODX recently, try manually deleting all files in the core/cache directory and visiting the site with your browser in private or incognito mode.

              If that doesn't do it, it's definitely a permission problem. The simplest cause would be that the Policy used for the Context Access ACL entry that gives you access to the 'mgr' context is missing the 'delete_document' or 'remove' permission.

              If a resource you're trying to delete is also in a resource group, the Resource Group Access policy may be missing the 'delete' or 'remove' permissions.

              If the resource has children that are in a resource group, it could be the same problem but for one or more of the children.

              If it's not that, it could be a TV attached to the Resource's Template that you don't have permission to edit or view.

              Some people have had weird permission problems when view_template permission is missing from the Context Access Policy.

              Be sure to flush permissions and log out after making any changes.
                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
                • 46584
                • 29 Posts
                Thanks for the advice Bob

                I found menu_trash just needed to be added to the Admin Access Policy - it's working fine now
                - I'm guessing that's a new thing from the last MODX core update
                  • 47589
                  • 6 Posts
                  Thank you both for your endeavors.

                  I can confirm in my instance it was a permissions error also. The menu_trash option in ACL was unticked.

                  Thanks again!
                    • 3749
                    • 24,544 Posts
                    The one permission I didn't mention, LOL.

                    It's unchecked on the Administrator policy in my 2.7.0 install. I think it's a Setup bug, since AFAIK, all permissions are checked in the default Administrator policy.

                    Could you file that as a bug here: https://github.com/modxcms/revolution/issues?
                      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