modxcms/revolution — pull request #11927 by rtripault (2014-08-21 06:55:32+00:00)
Title: Fixed a few issues in modX->_loadExtensionPackages preventing to load some services & handle table prefix

### What does it do ?

Fixed a few issues in `modX->_loadExtensionPackages` preventing to load some services & handle table prefix

### Why is it needed ?

"Auto loading" services fail without this, as well as packages using table prefix.

### To do next

While digging on that issue, it also appeared there is some inconsistencies about path... (mostly about services).
If `modExtensionPackage.path` is empty, it will fallback to `modNamespace.path` (see https://github.com/modxcms/revolution/blob/master/core/model/modx/modcachemanager.class.php#L466).

Later, we add `model/` to the extension path (see https://github.com/modxcms/revolution/blob/master/core/model/modx/modcachemanager.class.php#L471), no matter if `model` is already present or not (ie. being set in `modExtensionPackage.path`).

Then, if a `modExtensionPackage.service_class` & `modExtensionPackage.service_name` is found, we try to load the appropriate service, using the package path... (ending with `model/`).
This will result in an error, since no service will be found : the path should have been `../model/$namespace`, unless the service_class is `Namespace.ServiceClass`.

Hope it makes sense.

### Related issue(s)/PR(s)

* #9573