Skip to content
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

Crash when calling insertAfter() on Silverstripe 5 in the Discount object #117

Open
juan007 opened this issue Aug 16, 2024 · 0 comments
Open

Comments

@juan007
Copy link

juan007 commented Aug 16, 2024

The module on version 2.1 that is compatible with silvershop/core 3.1 that at the same time has Silverstripe 5 Support is throwing a type error. This is happening because the Discount class is using the deprecated (now removed) spec for insertAfter().
This was fixed in eb070ac and tagged in 3.0.2, but given 2.1.0 supports 3.1.1 of silvershop/core it probably should be backported to the 2.1 release chain.

This is the error:
[Emergency] Uncaught TypeError: SilverStripe/Forms/FieldList::insertAfter(): Argument #2 ($item) must be of type SilverStripe/Forms/FormField, string given, called in
.../vendor/silvershop/discounts/src/Model/Discount.php on line 252

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

No branches or pull requests

1 participant