fix(product): persist composite PK when creating product links - #561
Open
Ibochkarev wants to merge 1 commit into
Open
fix(product): persist composite PK when creating product links#561Ibochkarev wants to merge 1 commit into
Ibochkarev wants to merge 1 commit into
Conversation
xPDO fromArray() skips PK fields on msProductLink, so save() failed and the API returned ms3_err_unknown. Write link/master/slave via set() and return ms3_err_link_save / ms3_err_no_link instead.
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.
Описание
POST /api/mgr/product-data/{id}/linksотвечал 400 «Неизвестная ошибка»: уmsProductLinkсоставной PK(link, master, slave), аfromArray()безsetPrimaryKeysэти поля не пишет.save()возвращалfalse,create()прятал это вms3_err_unknown.В
error.logxPDO подтверждает пустой INSERT:Тот же HY000/1364 в 17:14:47 и 17:14:54.
Поля пишутся через
set(), как вProductLinksWriter. Неизвестный тип связи даётms3_err_no_link. Сбойsave()или meshmany_to_manyдаётms3_err_link_saveи запись в системный журнал. Кнопки «Сохранить» и «Сохранить и закрыть» ходят в один endpoint. Менять Vue не пришлось.Тип изменений
Связанные Issues
Closes #558
Как это было протестировано?
Vue не менялся,
npm run lint:ciне запускался.composer ci:php/composer test,npm run lint:ci,composer stan/ GitHub Actions CI)Конфигурация тестирования:
beta(1.13.0-beta1)Скриншоты (если применимо)
Не приложено. Проверьте вкладку «Связи» у товара: «Сохранить и закрыть» должно закрыть диалог и обновить грид.
Чеклист
composer stan/ CI jobPHPStan)npm run lint:ciдля Vue)Дополнительные заметки
remove()по-прежнему отдаётms3_err_unknownпри сбое DELETE. Это вне #558.