craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
219 stars 170 forks source link

[4.x]: Single line postcode formula input can break formulas added in Craft3 #3147

Closed chrismou closed 2 months ago

chrismou commented 1 year ago

What happened?

Description

I've just noticed the postcode formula box in shipping zones has changed from a textarea to a single line input in Craft4

There's a couple of issues here, especially when dealing with complex rules. One is that a textarea allowed us to format the rule with spacing and multi lines to make it more readable, eg:

image

Another, tying into this, is that the newline character is now ignored, effectively breaking the rule, eg

Craft3 image

Craft4 image

Note the lack of space now between the closing bracket and the OR. This works for now because I assume it's still saved with the newline, but I would guess that if I now hit save, it would strip out newline and the rule would break

I appreciate that these could be reformatted, but it'll just make life a lot more difficult for the next developer who's asked to make a "quick change" to the formula :sweat_smile:

Is there any way this could be changed back to a textarea?

Craft CMS version

4.x

Craft Commerce version

4.x

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

-

lukeholder commented 1 year ago

Thanks for reporting this, I will take a look and let you know how we can improve the situation.

lukeholder commented 6 months ago

Thanks for reporting. This will be fixed for the next release. I will let you know here once it's out later today.

lukeholder commented 2 months ago

This was fixed in 4.5.3 thanks!