Mandatory field space only input causes error

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
IvanIgniter
Posts: 58
Joined: 01 Dec 2021, 07:41

Mandatory field space only input causes error

Post by IvanIgniter » 22 Feb 2022, 11:08

I am using laravel 6.x, PHP 7.4, Docker desktop/Ubuntu and the Aimeos 2021 (aimeos-laravel: 2021.10.4 / aimeos-core: 2021.10.13)

We are having an issue in the product detail page mandatory field when inputting just a space only will cause error 500 after saving. How can we adjust the code so it won't accept just a space?
a3.jpg
a3.jpg (88.3 KiB) Viewed 1069 times

User avatar
IvanIgniter
Posts: 58
Joined: 01 Dec 2021, 07:41

Re: Mandatory field space only input causes error

Post by IvanIgniter » 23 Feb 2022, 13:10

Any documentation how does aimeos filter each required field so we could enhanced each field filter needs?

User avatar
aimeos
Administrator
Posts: 7923
Joined: 01 Jan 1970, 00:00

Re: Mandatory field space only input causes error

Post by aimeos » 24 Feb 2022, 07:19

Currently, Aimeos only checks if the SKU isn't empty and for some invalid characters but not for white spaces:
- https://github.com/aimeos/aimeos-core/b ... d.php#L158
- https://github.com/aimeos/aimeos-core/b ... #L480-L491

Think, we should add spaces too.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
IvanIgniter
Posts: 58
Joined: 01 Dec 2021, 07:41

Re: Mandatory field space only input causes error

Post by IvanIgniter » 28 Feb 2022, 08:06

Yeah that is my question how to avoid inputting a white space for a mandatory fields?
Is there any solutions?

User avatar
aimeos
Administrator
Posts: 7923
Joined: 01 Jan 1970, 00:00

Re: Mandatory field space only input causes error

Post by aimeos » 01 Mar 2022, 08:55

Only in dev-master. You can overwrite the JQAdm template for the product detail view and add a regex to the input field that forbids white spaces only:
https://developer.mozilla.org/en-US/doc ... es/pattern
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply