commerce icon indicating copy to clipboard operation
commerce copied to clipboard

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

Open chrismou opened this issue 2 years ago • 2 comments

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

chrismou avatar Apr 19 '23 15:04 chrismou

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

lukeholder avatar May 30 '23 08:05 lukeholder

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

lukeholder avatar Mar 27 '24 15:03 lukeholder

This was fixed in 4.5.3 thanks!

lukeholder avatar Jul 24 '24 09:07 lukeholder