-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Type mismatch in EcommerceBundle installed classes #75
Comments
The Issue only occurs if the settings for the number field in the OnlineShopOrder Class are changed. If there are max. decimals defined the type changes from float to string and the definitions are compatible. |
Can we reopen this? I didn't change any of the values from the default and they were still empty. So I got the same error after trying to upgrade (in addition to #76). The site was originally running on 6.8 but has been on 6.9 for a while now. |
Thanks a lot for reporting the issue. The issue was not considered by us as "Priority" or "Backlog", so we're not gonna work on that anytime soon. In case this is a bug report, please create a pull request fixing the issue, we'll then review it as soon as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request, we'll then decide whether we'd accept it or not. Thanks for your understanding. |
This is "silly".
In the generated class definition for DataObject Really annoying that your code is not compatible on its own. |
Why don't you provide a PR to fix it? |
I'm new to Pimcore and really don't know how it exactly works. I can prepare a MR with the changes of typing in |
Thanks. In my setup decimal size and precision are defined and the generated class methods are typed as following:
So the generated class works perfectly find, but the my problem is related with the Abstract class
where in AbstractOrderItem we have
I was surprised that even in OrderManager there is a I try to find a way how to check if there a string or float is used in OrderManager BWT Storing $ as a decimal should be illegal ❗ |
@jdreesen can you guide me if there could be sth in my field configuration or in code? I am blink right now. And, I did not write it before. I'm using Pimcore v10.5.17 and use MariaDB 10.5 if this change anything |
I'm sorry, I don't know what can cause this at the moment, it's very strange. Hopefully someone of the pimcore team can help here? @dvesh3, etc. |
I found that in my |
"Numeric" should be right. The generated scalar types depend on the config, this is where they come from: https://github.com/pimcore/pimcore/blob/10.5/models/DataObject/ClassDefinition/Data/Numeric.php#L152-L163 |
@jdreesen 🎖️ for you. I found it. Thank you a lot !!!! tl;dr So what happened? After migration settings for decimal size and precision of How to fix thatMaybe it could be useful for someone.
Option one -> in code
Option two -> in admin |
Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding. |
we had a similar problem (Exception: class must be compatible with a Ecommerce Abstract Class) with |
Expected behavior
Installed classes of EcommerceBundle match the provided abstract classes.
See i.e. https://github.com/pimcore/pimcore/blob/10.x/bundles/EcommerceFrameworkBundle/Resources/install/class_sources/class_OnlineShopOrderItem_export.json#L289
vs.
https://github.com/pimcore/pimcore/blob/10.x/bundles/EcommerceFrameworkBundle/Model/AbstractOrderItem.php#L72
Actual behavior
An error occures
Compile Error: Declaration of Pimcore\Model\DataObject\OnlineShopOrderItem::getTotalPrice(): ?float must be compatible with Pimcore\Bundle\EcommerceFrameworkBundle\Model\AbstractOrderItem::getTotalPrice(): ?string
Steps to reproduce
Create OnlineShopOrderItem and extend from AbstractOrderItem of EcommerceBundle.
See https://github.com/pimcore/pimcore/blob/10.x/bundles/EcommerceFrameworkBundle/Resources/install/class_sources/class_OnlineShopOrderItem_export.json#L289
The text was updated successfully, but these errors were encountered: