CoreShop
CoreShop copied to clipboard
Support class names whose name begins with lowercase letter
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Steps to reproduce bug:
- Create class with lowercase first letter, e.g. product, extend
\CoreShop\Component\Core\Model\Product
- Set up the custom class configuration like described in https://docs.coreshop.org/2.2.0/Development/Extending_Guide/Extend_CoreShop_DataObjects.html:
core_shop_product: pimcore: product: classes: model: 'Pimcore\Model\DataObject\Product'
- Go to "cart price rules", add new rule, add
Products
condition, click "Search" -> you see that the defined Product class is not preselected.
The other fixed thing is when you override a data object class and set core_shop_product.pimcore.product.classes.model
to the overridden FQCN (e.g. \App\Model\DataObject\Product), then https://github.com/coreshop/CoreShop/blob/aff8053fcd566bc1462112550cda413c854013e8/src/CoreShop/Bundle/ResourceBundle/DependencyInjection/Compiler/StackClassesPass.php#L58 does not have any effect.
@BlackbitNeueMedien I fixed tests for 2.2, can you rebase to latest 2.2?
Have I missed something? I merged up-to-date 2.2 branch but it complains about missing database columns.
The problem still exists, also in 3.0 - do you know why you closed it, @dpfaffenbauer ? Because https://github.com/coreshop/CoreShop/pull/1896#pullrequestreview-982714728 can be easily fixed.
This is actually quite difficult to solve. Problem is that during Container build time the ClassDefinitions cannot be loaded cause some of them require the kernel to be booted. So to fix this, I load the tokens from the definition file and try to find the classname, feels a bit dirty to me honestly, you might wanna check: https://github.com/coreshop/CoreShop/pull/2097