revolution icon indicating copy to clipboard operation
revolution copied to clipboard

Update modX.[add|remove]ExtensionPackage to use new modExtensionPackage model

Open Mark-H opened this issue 11 years ago • 3 comments

To preserve BC while introducing new features, I think the addExtensionPackage and removeExtensionPackage methods should be updated to prefer storing the data in a modExtensionPackage object instead of in the extension_packages setting.

The removeExtensionPackage method should check both the system setting and the database for matching extension packages. The addExtensionPackage should just write to the table.

If there's any potential issues that can come from having a package in both the setting and database, maybe the addExtensionPackage should also remove from the system setting to prevent duplicates, but I can't think of any issues off-hand.

Mark-H avatar Jun 05 '14 09:06 Mark-H

This still seems like a good idea to me. The ClassExtender extra calls addExtensionPackage() and the result is still written to the system setting, and the modExtensionPackage table remains empty.

BobRay avatar Aug 26 '22 21:08 BobRay

I also find that packages in the modx_extension_packages table don't seem to be loaded when $modx->initialize() calls _loadExtensionPackages(). They're retrieved with this call:

$cache = $this->call(modExtensionPackage::class, 'loadCache', [&$this]);

But $cache is empty after the call. In stepping through in the debugger, it looks like xPDO's call to $modx->getCacheManager() is failing in a way that prevents the $return variable from being set at all.

BobRay avatar Aug 30 '22 03:08 BobRay

This issue has been mentioned on MODX Community. There might be relevant details there:

https://community.modx.com/t/trouble-with-extensionpackage-object-in-modx-3/5728/2

rthrash avatar Sep 01 '22 06:09 rthrash