Skip to content

fix(vuetools): add VueTools\Service for MODX service container#6

Open
Ibochkarev wants to merge 1 commit intomasterfrom
fix/vuetools-service-class
Open

fix(vuetools): add VueTools\Service for MODX service container#6
Ibochkarev wants to merge 1 commit intomasterfrom
fix/vuetools-service-class

Conversation

@Ibochkarev
Copy link
Copy Markdown
Member

@Ibochkarev Ibochkarev commented Mar 2, 2026

MODX 3 resolves the vuetools service by loading class VueTools\Service from model/vuetools/. The component only had VueCore in src/ and registered the service via a closure in bootstrap, so xPDO attempted the conventional class load first and failed with "Could not load class: VueTools\Service from vuetools\service".

[2026-03-02 06:41:43] (ERROR @ /home/c/ck19835/ms3/public_html/core/vendor/xpdo/xpdo/src/xPDO/xPDO.php : 667) Could not load class: VueTools\Service from vuetools\service
[2026-03-02 06:41:43] (ERROR @ /home/c/ck19835/ms3/public_html/core/vendor/xpdo/xpdo/src/xPDO/xPDO.php : 1273) Problem getting service vueTools, instance of class VueTools\Service, from path /home/c/ck19835/ms3/public_html/core/components/vuetools/model/vuetools/

Add core/components/vuetools/model/vuetools/Service.php that extends VueCore and explicitly requires VueCore.php so the class is loadable regardless of bootstrap/autoload order. $modx->services->get('vuetools') then resolves to the same behaviour (Import Map, styles, etc.) without errors.

No build changes: the package already ships the full core/components/vuetools/ tree, so the new model/ directory is included automatically.

MODX 3 resolves service 'vuetools' by loading VueTools\Service from
model/vuetools/. Add Service.php extending VueCore so getService('vuetools')
succeeds and xPDO no longer logs 'Could not load class'.
@Ibochkarev Ibochkarev marked this pull request as ready for review March 2, 2026 03:46
@Ibochkarev Ibochkarev requested a review from biz87 March 3, 2026 05:33
@Ibochkarev Ibochkarev self-assigned this Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant