refactor(product): simplify Product\GetList — remove non-combo logic#152
Merged
refactor(product): simplify Product\GetList — remove non-combo logic#152
Conversation
- Remove non-combo branch from prepareArray() (actions, preview_url, cls, etc.) - Remove non-combo branches from prepareQueryBeforeCount() (full select, parent filter, nested) - Remove $parent property - Add combo validation in initialize() - Add ms3_err_processor_combo_required lexicon (en/ru) Fixes #151
biz87
approved these changes
Mar 16, 2026
Member
biz87
left a comment
There was a problem hiding this comment.
Code Review
Чистый рефакторинг, точно по задаче из #151.
Проверки
xPDOQueryCondition— импорт оставлен корректно, используется вprepareQueryAfterCount()VendorиCategoryLEFT JOIN — нужны для поиска поVendor.name:LIKEиCategory.pagetitle:LIKEв combomsCategoryMemberJOIN — удалён корректно, использовался только в non-combo parent-фильтрации$this->failure()вinitialize()— стандартный MODX-паттерн, совместим с возвратом метода- Лексиконы на двух языках — ок
Мелкое замечание (некритичное)
GROUP BY msProduct.id — после удаления msCategoryMember JOIN остались только 1:1 LEFT JOIN'ы (Data, Vendor, Category), дубликатов быть не может. GROUP BY теперь избыточен. Можно убрать для чистоты, но не блокирует мерж.
LGTM
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.
Описание
Упрощён процессор
Product\GetList: удалена неиспользуемая non-combo логика. После мержа #146 процессор вызывается только сcombo: trueиз ms3.combo.js — вся остальная ветка была мёртвым кодом.Изменения:
prepareArray()(actions, preview_url, cls, category_name, округление price/weight)prepareQueryBeforeCount(): full select, parent-фильтрация, nested products, join msCategoryMember$parentcombo: trueвinitialize()— при некорректном вызове возвращается ошибкаms3_err_processor_combo_required(en/ru)Поведение combo-выбора товаров (ms3.combo.Product) не меняется.
Тип изменений
Связанные Issues
Fixes #151
Как это было протестировано?
Чеклист