Repository navigation
Исправление ошибки «ms3_shipment_lifecycle requires MODX PDO» при инициализации сервиса - #992
Open
Ibochkarev wants to merge 2 commits into
Open
Ibochkarev wants to merge 2 commits into
Ibochkarev wants to merge 2 commits into
Conversation
modx->pdo is still null when these factories run early: it is a reference to the xPDO connection PDO, which only exists after the first getObject()/query. getConnection() returns either the PDO itself or the xPDOConnection wrapper; handle both explicitly. Single pdo() helper replaces three inline checks and documents that only a real PDO is accepted (profiler wrappers use composition).
Member
Author
|
Перебазировал на Исходный подход ( Деплой на стенде: healthcheck зелёный, |
Ibochkarev
force-pushed
the
fix/shipment-pdo
branch
from
November 9, 2026 03:11
d7c551d to
290911c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
ms3_shipment_lifecycle,ms3_payment_lifecycleиms3_inventoryпадали с500 "requires MODX PDO"при раннем резолве сервисов (страница заказа в менеджере:GET /api/mgr/orders/{id}/shipment).Причина:
$modx->pdoещё null при инициализации фабрики — это reference на PDO внутри xPDO-соединения, которое создаётся только при первом запросе. Прямойinstanceof \PDOв фабрике поэтому падал.Правка: один хелпер
ServiceRegistryFactories::pdo()— если$modx->pdoуже PDO, вернуть его; иначе вызватьgetConnection()и разобрать оба случая (сам PDO илиxPDOConnectionс->pdo). Только реальный PDO, профайлер-обёртки не принимаются.Тип изменений
Связанные Issues
—
Как это было протестировано?
php -l, Unit (818 tests), PHPStan — чисто.project.test:GET /api/mgr/orders/1219/shipmentотдаёт данные вместо 500.