Repository navigation
fix(issue-883): preserve address fields & msOrderTotal snippet on upgrade - #1019
Open
Ibochkarev wants to merge 1 commit into
Open
Ibochkarev wants to merge 1 commit into
Ibochkarev wants to merge 1 commit into
Conversation
…rade - Add editedon check for ms3_order_address_fields setting (modx-pro#883) - Default fields (entrance, floor, text_address) are added only if the setting has never been manually edited (editedon is empty). - If editedon is set, user changes are preserved. - Add editedon check for msOrderTotal snippet properties (modx-pro#883) - Default properties (tpl, return) are set only if the snippet has never been manually edited. - If editedon is set, custom properties are preserved. - Add integration tests (Resolver03SettingsTest) covering both scenarios: - testAddressFieldsNotEditedAddsDefaults - testAddressFieldsEditedKeepsOriginal - testAddressFieldsEditedWithCustomFields - testSnippetNotEditedSetsDefaults - testSnippetEditedKeepsOriginalProperties - testSnippetNotEditedMergesWithExisting All tests pass: vendor/bin/phpunit --testsuite Integration PHPStan: composer stan — [OK] No errors
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.
Описание
При обновлении пакета MiniShop3 резолвер
resolver_03_settings.phpпринудительно перезаписывает:ms3_order_address_fields— добавляетentrance,floor,text_addressкаждый раз, игнорируя пользовательские правки.msOrderTotal—tplиreturnперезаписываются значениями по‑умолчанию, теряя кастомные шаблоны.Исправление
Добавлены проверки
editedonперед модификацией (паттерн аналогиченms3_chunks_categories):editedonпустой (запись не редактировалась вручную).editedonпустой).Тесты
Добавлен
Resolver03SettingsTestс 6 кейсами:editedon= nulleditedon!= nulleditedon= nullПроверки
Closes #883