fix(settings): связка способа оплаты с доставкой в менеджере - #629
Open
Ibochkarev wants to merge 1 commit into
Open
fix(settings): связка способа оплаты с доставкой в менеджере#629Ibochkarev wants to merge 1 commit into
Ibochkarev wants to merge 1 commit into
Conversation
addLink() used fromArray() without setPrimaryKeys, so xPDO skipped delivery_id/payment_id on msDeliveryMember and save() failed when linking payment methods to deliveries in the manager UI. Closes #628
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.
Описание
В
Ms3ReferenceCrudService::addLink()при создании связиmsDeliveryMemberиспользовалсяfromArray($criteria)безsetPrimaryKeys = true. Для таблицы с составным PK (delivery_id,payment_id) xPDO не записывает поля первичного ключа,save()возвращаетfalse, API отдаёт «Failed to add payment to delivery».Правка: явный
set()дляmemberOwnFkиmemberPeerFk, как уже сделано вreplaceLinks()и вProductLinkService::addLink().Closes #628
Тип изменений
Связанные Issues
Closes #628
Как это было протестировано?
composer ci:php/composer test,npm run lint:ci,composer stan/ GitHub Actions CI)Конфигурация тестирования:
Скриншоты (если применимо)
Чеклист
composer stan/ CI jobPHPStan)npm run lint:ciдля Vue) — Vue не затронутДополнительные заметки
Затронутые эндпойнты:
POST /api/mgr/deliveries/{id}/paymentsPOST /api/mgr/payments/{id}/deliveriesРегрессионный тест:
tests/Unit/Services/Reference/Ms3ReferenceCrudServiceAddLinkTest.php(probe имитирует xPDO:fromArray()без PK →save()false).