snippet-library icon indicating copy to clipboard operation
snippet-library copied to clipboard

`gw-limit-multi-selects.php`: Fixed issue where setting the `min` to `1` did not work.

Open veryspry opened this issue 11 months ago • 0 comments

Context

⛑️ Ticket(s): https://secure.helpscout.net/conversation/2499159955/60820/

Summary

If no options are selected for a configured multi-select, the $value arg in validate() will be an empty string and the function will return early without setting a validation error.

The fix is to explicity set $count to 1 if an empty string is detected so that the remainder of the logic will work as expected.

veryspry avatar Mar 22 '24 10:03 veryspry