You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I discovered an issue when i tried saving an empty row. I expected it to have the same behaviour as delete_empty would have, but instead the plugin tried to save the empty row. Which throwed an exception because null is not a NumberType. I tried to add the delete_empty => true to the collection type, but this did not have any effect. I added a suggestion to fix this, but of course any other fix is also very welcome. I am not able to provide a PR due to time constraints.
How to reproduce issue
Add 1 or more valid tierprice to any product variant
Add a empty row to tierprices
Save tierpricing
Then the following error is shown: Expected argument of type "int", "null" given at property path "qty".
Suggested fix / workaround
Add empty_data => 0 to both the qty and price types in the TierPriceType
The text was updated successfully, but these errors were encountered:
The problem in this case is that the Symfony form produces bad values that the entity doesn't allow. I think one way to fix this is to make everything in the entity nullable (like Sylius does by default as well). However this makes the code rather hard to use with correct typing as the null value is only possible until the entity is validated. Another option would be to create a custom data mapper.
I discovered an issue when i tried saving an empty row. I expected it to have the same behaviour as
delete_empty
would have, but instead the plugin tried to save the empty row. Which throwed an exception becausenull
is not aNumberType
. I tried to add thedelete_empty => true
to the collection type, but this did not have any effect. I added a suggestion to fix this, but of course any other fix is also very welcome. I am not able to provide a PR due to time constraints.How to reproduce issue
Then the following error is shown:
Expected argument of type "int", "null" given at property path "qty".
Suggested fix / workaround
Add
empty_data => 0
to both theqty
andprice
types in theTierPriceType
The text was updated successfully, but these errors were encountered: