Skip to content

fix: add class_key to getIterator for msProduct/msCategory (#87)#90

Merged
biz87 merged 1 commit intobetafrom
dev/1.4.1-beta
Feb 15, 2026
Merged

fix: add class_key to getIterator for msProduct/msCategory (#87)#90
biz87 merged 1 commit intobetafrom
dev/1.4.1-beta

Conversation

@biz87
Copy link
Copy Markdown
Member

@biz87 biz87 commented Feb 15, 2026

Summary

  • xPDO::getIterator() does not call addDerivativeCriteria(), unlike getCollection()
  • For classes without their own table (msProduct, msCategory extend modResource), queries return wrong class instances
  • Added explicit class_key filter to all affected getIterator calls

Affected files:

  • CategoryProductsController::getChildCategories() — root cause of the bug
  • CategoryProductsController::getList() — defense-in-depth
  • ReferencesController::searchProducts() — real risk
  • Settings\Option\Get::beforeOutput() — defense-in-depth

Fixes #87

Test plan

  • Open category with nested subcategories containing products — no xPDO errors
  • Search products in References API — only msProduct returned
  • Open option settings — only msCategory in categories list

🤖 Generated with Claude Code

xPDO::getIterator() does not call addDerivativeCriteria(), unlike
getCollection(). For classes without their own table (msProduct,
msCategory extend modResource), this causes wrong class instantiation.

Added explicit class_key criteria to all affected getIterator calls:
- CategoryProductsController::getChildCategories()
- CategoryProductsController::getList()
- ReferencesController::searchProducts()
- Settings\Option\Get::beforeOutput()

Fixes #87

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@biz87 biz87 merged commit d2030a5 into beta Feb 15, 2026
@Ibochkarev Ibochkarev deleted the dev/1.4.1-beta branch March 16, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Ошибка при входе в каталог

2 participants