-
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
[Ecommerce Framework] Migration which enables generateTypeDeclarations #76
Comments
@BlackbitNeueMedien In the upgrade notes, it is mentioned that you to activate the And there are migrations already exists which regenerates the class definitions on upgrade to Pimcore X(https://github.com/NiklasBr/pimcore/blob/10.1/bundles/CoreBundle/Migrations/Version20210702102100.php), it is not enough? |
@dvesh3 - it is always nice when things are documented, but isn't it even nicer when it just works? What speaks against a migration which enables |
@BlackbitNeueMedien hmm, I'm just wondering ... can we really create a migration that adds type declarations without breaking existing code? So if some fixes the issue already manually I mean 🤔 |
@brusch I cannot follow you. How can someone have fixed this problem already manually if not by enabling |
@BlackbitNeueMedien we are ok with a migration that enables |
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. |
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. |
In pimcore/pimcore#8040 the interfaces for the data model classes of the Ecommerce Framework bundle were extended so that the getter methods require return type declarations, e.g.:
https://github.com/pimcore/pimcore/blob/5661134f4bb8841dba8f6aa458277df89e50622c/bundles/EcommerceFrameworkBundle/Model/AbstractFilterDefinition.php#L33
Sadly there never was a migration for this. Consequently Pimcore crashes when you had the Ecommerce framework classes installed in Pimcore 6 (where
generateTypeDeclarations
did not exist yet) and update to Pimcore X. It also does not matter if you are actually using the Ecommerce Framework data object classes because they are loaded anyway once they got created and so the system crashes on every request:Declaration of Pimcore\Model\DataObject\FilterDefinition::getPageLimit() must be compatible with Pimcore\Bundle\EcommerceFrameworkBundle\Model\AbstractFilterDefinition::getPageLimit(): ?float
This means that without
generateTypeDeclarations
being enabled the ecommerce framework classes will not work.Also if you accidentically uncheck the
generateTypeDeclarations
checkbox in the class definition of one of the Ecommerce framework classes the same will happen.In both cases you will not be able to access the Pimcore backend anymore and instead have to manually edit the class definition files and set
generateTypeDeclarations
totrue
.A migration which enables
generateTypeDeclarations
for the corresponding classes would solve at least the problem when updating from earlier Pimcore versions to Pimcore X. I do not know if we can solve the problem of unchecking thegenerateTypeDeclarations
checkbox manually.The text was updated successfully, but these errors were encountered: