Cannot permanently delete resources in/after upgrade to Modx 2.7

I cannot permanently delete resources in modx 2.7.x after an update, when clicking on the little grbage can icon I get the message: “Could not find action file at: controllers/default/resource/trash.php”

Looking on disk, that file does not exist in that location or anywhere on the server - including about 40 other modx sites. Spot checking a few different site, the manager in those give the same action file not found error.

How to fix this??

Do you have the file manager/controllers/default/resource/trash.class.php?

That should be the file it looks for first. I don’t have a trash.php file either, but I can empty the trash with no error.

Similar post which suggests it was (at least partially) solved by running the upgrade again: Cannot permanently delete resources in/after upgrade to Modx 2.7

Nope - out of about 40 sites on the server trash.class.php exists in 2 places, in a backup of a previous version and in one installation that was not updated to 2.7.something.

Just tried this … no dice. I ran the advanced update and the regular one cleared cache etc … still got the missing action file error.

At some point the behavior changed from just deleting all resources marked for deletion to launching the controller that lets you select specific marked resources for permanent deletion. You seem to have been caught between the two (the controller is called, but didn’t get installed).

IIRC, the old way fired some JS that launched an “empty trash” processor. In my 2.7.1 install, the resource/trash/purge processor is still there, although I don’t think it’s ever called.

I do have the manager/controllers/default/resource/trash.class.php file.

The file is here if you want to try installing it manually.

I think I see now … I have always used the advanced install - when I used the regular one here I forgot to rename the manager and connectors directory before copying them over. Fix directory names, reapply update and it is showing the trash manager now …

It appears that it does not get updated correctly with the advanced package, but does with the general distribution.

Must be a good place to report such a bug…

MODX issues

FWIW, the UpgradeMODX extra essentially converts the Advanced distribution into the Standard one, so it would probably have created the file properly.

I’ve argued for a while now that there should only be one distribution of MODX with the “advanced” features built into it.

really it should be built right into modx or at least the option to 1-click it … but I make $$ from each update, soooo I don’t push too hard :wink:

1 Like

So I have the same problem, but with slightly different symptoms.

My client deleted several resources a long time ago but never emptied the trash. Now we’re on 2.7.1. When I click on the trash icon, the “Trash - Deleted Resources” page comes up, but there are no resources listed to purge.

How do delete them?

Are they listed in the Resources tree?
If so, and they’re not marked for deletion, you should be able to right-click on them and mark them for deletion. Then they should show up in the grid.

Have you looked in the DB to see if they’re there and if the deleted field is set to 1?
If you do find them in the DB and not the tree, check to see if the parent field points to an existing resource (SiteCheck will report resources with invalid parents).

I’d also take a look at the Network tab in Dev. tools (Ctrl-shift-i) while loading the grid to see if it reports any missing files.

1 Like

The resources were in the tree and marked deleted in the database. Then I realized the server was still running php 5.6, so I upgraded that to 7.3 still no change. I even tried undeleting and deleting again. No change. So I upgraded Modx from 2.7.1 to 2.7.2 and they all appeared in the grid and I was able to delete them.

Thanks for you help, you got me pointed in the right direction.

Thanks for reporting your solution. :slight_smile:

I had the same problem in 2.7.3.
After checking all the suggestions presented here, it was still without solution (resources appeared deleted in the resource tree, but did not appear in the grid of the trash manager).
Looking in the logs, I saw a collation error (utf8mb4_unicode_520_ci in the server connection, but utf8mba_spanish_ci in the site database), probably because I had just uploaded the site to a new server and I didn’t take it into account.
I have changed the collation of the tables to utf8mb4_unicode_520_ci, and problem solved, the grid has worked again.
I don’t really know why, but …
Health.