Hopefully RESOLVED!
I spent some time experimenting (changing some MODX code) and in the process needed to remove and attempt to reinstall packages. I returned the modified code back to the way it was after discovering what was really happening. This is the behaviour — the problem is a situation that can occur that MODX does not detected early enough and results in later code failing and issuing a misleading error message(s).
Let me describe the situation that first prompted this thread and describe what caused the problem.
In 2.0.8, a web develper attempted, unsuccessfully to install the Gallery extra. The attempt mucked up things royally and I was asked if I could get MODX functional again without losing the work done since the last backup (as ususal, backups were not being taken frequently enough).
I went into the Package Manager and clicked "Uninstall", which (if I remember, which I may not) more or less worked. It didn't solve the problem, but then I went into core/packages/ and trashed any files that had any mention of Gallery in their names and also went through all the resources and categories and did the same. I cleared the cache (using the MODX command and by trashing the contents of the core/cache/ directory). Apparent success. Development continued and eventually the site went live.
Fast forward to the present. After an apparently successful upgrade to 2.2.9, I went into the Package Manager and clicked "Install" on the line for Gallery.
If this seems alright to you, then you have missed the point — just as I did
THE REAL PROBLEM
Package Management has two distinct functions when it comes to installation and their counterparts when it comes to uninstall:
- Download the transport file
- Install
- Uninstall
- Remove the transport file
What I had failed to do was use the MODX Package Manager to remove the transport file (I had done it directly in the file system). The result was that MODX "remembered" the package had been installed and showed it in the grid. This "memory" persisted through the upgrade.
CORRECT APPROACH
Correct is always to use the MODX Package Manager to trash the transport files as it will, effectively, remove its "memory" of them.
So installing a new package should involve
- Use the "Download Extras" button of the Package Manger to download the transport file. This will cause MODX not only to download the file, but also remember it and show the package in the grid.
- Use the "Install" button that shows in the entry for the package in the grid.
That DOES work fine. Notice that if the transport file had been trashed manually, but you "put it back" (by downloading it and putting in the core/packages/ directory), the install will work (as long as you download the correct version of the transport file).
FIXING THE PROBLEM IF YOU DO GET IT
If the transport files have been removed, but the package still shows in the grid (hopefully it was either not installed or you uninstalled it before the transport files got removed), then use the "Remove" button for the package. It may produce some error messages, but it will get rid of the "memory" of the package. If there had been prior versions of the same package, use "Remove" as many times as necessary to get rid of them as well (so that the grid no longer shows the package).
______________