Is your feature request related to a problem? Please describe.
Following the addition of new invalid characters in customer creation forms in 1.7.5.2, we have to update the error messages and the tips in the customer creation page in the BO.
Now, when using an invalid character listed in the tip:
Now, when using one of the new invalid characters added:
[UPDATED 07/17/2109]
Describe the solution you'd like
1/ The list of invalid characters triggering the error message should be updated. New list:
0-9!<>,;?=+()@#"°{}_$%:/\`^*
If a dot ( 。or . ) is not followed by a space, it is considered invalid as well.
2/ The tips under the firstname and lastname fields should be replaced by:
Only letters and the dot (. or 。) character are allowed.
3/ New error Message when using an invalid character or a dot with no space:
The
field is invalid.
Invalid characters: 0-9!<>,;?=+()@#"°{}_$%:/\`^*
A space is needed after "." and "。".
(First name or Last name depending on the field with an error)
Additional context
For similar issue see #13640
Hi @LouiseBonnard,
We just discussed this issue with Pablo, he says it might be better to indicate below the fields the valid characters instead of the forbidden ones.
In this case only letters and "." followed by a space are valid.
And in the error message indicates the invalid characters.
Wdyt?
Indeed, it seems clever regarding the number of forbidden characters, aha! In this case, I'd write _Only letters and the dot (. or 。) character are allowed._ localized in _Admin.Orderscustomers.Help_ but I'm still wondering about the Chinese dot character, it looks a bit weird when mentioning it.
🤔
I would let the Chinese dot character
It is quite unusual but why not. ;-)
FYI: I've just checked and BuiltWith talks about less than 200 PrestaShop stores active in China
@LouiseBonnard I updated the issue, can you check pls?
For the chinese dot I let you decide "Content Master" ;)
In my opinion, we have to remain as international as possible otherwise we will always have regional rules/exceptions/specifications to mention. If the "。" is the Chinese version of the ".", then I would like to keep the wording as international as possible and only mention the dot "." - it will be up to the merchants/customers to adapt it for its proper form if need be.
I can't remember the discussion we've had about this character, and why it was so important to mention it at this place. One thing I can do is ask the Chinese translators about this issue to get their feedback. :-)
@Progi1984, please wait for the wording to be validated, I'm expecting feedback from the translators' community before. ;-)
ALRIGHT, FOLKS! It seems that this last assumption is right, I've asked the wonderful Chinese translators and they all let me know that there are many ways to write a dot in Chinese, perhaps too many, aha! So we will only keep the international dot character: _Only letters and the dot (.) character are allowed._ in _Admin.Orderscustomers.Help_, thanks @Progi1984!
Also, this means that we will have to adapt the wording on the front. Currently, it is _A space is required after "." and "。"_ in _Shop.Forms.Errors_ (context: classes/ValidateConstraintTranslator.php at line 72). It will have to be _A space is required after the dot (.) character_ in _Shop.Forms.Errors_, okay for you?
@LouiseBonnard No problem for applying rules to front.
@samuel-pires I tried to use the regex from the front office but some characters are in more (in the front rather the back) : ¤
|
[
and ]
. Do i add or remove them from forbidden characters ?
Hi @matks, do you know if these 4 characters ⬆️ have been introduced in the 1.7.5.2? and if there is a reason for not having them in the BO?
@Progi1984 , we shouldn't remove them from the FO validation.
And I would say it's better to add them in the BO as well, though there is less risk of misuse in the BO as customers are created by someone from the staff.
Let's see what @matks recommends
Hi @matks, do you know if these 4 characters ⬆️ have been introduced in the 1.7.5.2? and if there is a reason for not having them in the BO?
Yes, it was introduced in 1.7.5.2 against spam attacks
@Progi1984 So we can ad these 4 invalid char in the BO validation as well.
If we let a merchant create a customer with one of these char and later the customer wants to modify account info in the FO he/she will have an error when trying to save the form, saying the name is not correct.
@samuel-pires Finally, it's that ?
Describe the solution you'd like
1/ The list of invalid characters triggering the error message should be updated. New list:
0-9!<>,;?=+()@#"°{}_$%:/`^*¤|[]
If a dot ( . ) is not followed by a space, it is considered invalid as well.
2/ The tips under the firstname and lastname fields should be replaced by:
Only letters and the dot (.) character are allowed.
Domain : Admin.Orderscustomers.Help
3/ New error Message when using an invalid character or a dot with no space:
The
field is invalid.
Only letters and the dot (.) character are allowed.
Domain : Admin.Orderscustomers.Help
(First name or Last name depending on the field with an error)
4./ Error in front must be changed :
A space is required after the dot (.) character
Domain : Shop.Forms.Errors
5/ The chinese dot is now authorized (。)
Hi @Progi1984, the modification on the Chinese dot (。) was only about the wording for the tips. It has to remain in the validation regex, we have to use the same regex in FO and BO.
Describe the solution you'd like
1/ The list of invalid characters triggering the error message should be updated. New list:
0-9!<>,;?=+()@#"°{}_$%:/`^*¤|[]
If a dot ( . or 。) is not followed by a space, it is considered invalid as well.
2/ The tips under the firstname and lastname fields should be replaced by:
Only letters and the dot (.) character, followed by a space, are allowed.
Domain : Admin.Orderscustomers.Help
3/ Error Message when using an invalid character or a dot with no space - reuse existing error message:
The %s field is invalid.
Domain : Admin.Notifications.Error
(%s being First name or Last name depending on the field with an error - this translation key already exists)
4./ Error in front must be changed:
A space is required after the dot (.) character
Domain : Shop.Forms.Errors
Is everything ok for you?
Most helpful comment
Hi @Progi1984, the modification on the Chinese dot (。) was only about the wording for the tips. It has to remain in the validation regex, we have to use the same regex in FO and BO.
Describe the solution you'd like
1/ The list of invalid characters triggering the error message should be updated. New list:
0-9!<>,;?=+()@#"°{}_$%:/`^*¤|[]
If a dot ( . or 。) is not followed by a space, it is considered invalid as well.
2/ The tips under the firstname and lastname fields should be replaced by:
3/ Error Message when using an invalid character or a dot with no space - reuse existing error message:
(%s being First name or Last name depending on the field with an error - this translation key already exists)
4./ Error in front must be changed:
Is everything ok for you?