-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customer Name Prefix shows white space when extra separator is addes.… #18077
Conversation
Hi @ivanbastos. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
@ivanbastos thanks for this PR. I remember an older issue and PR with regards to this. I think we need to make sure that we can still add an empty option when we choose prefix as optional. If that is not the case with your code changes then I would suggest it will need to be updated. |
Hi @ivanbastos , please, take a look at comment from @dmanners |
@ivanbastos I think this is not a bug, but intended behavior. It should be possible to have an empty option. But you're also right in that this is a problem if the field is set to required. Due to the PR @dmanners mentioned (#11462), an empty option is added in the optional case automatically, so I do not see a problem filtering it out, in general. I'll just have to check that optional prefix/suffix still offers the empty option with your change. |
@dmanners @ivanbastos I just verified that this change does not break PR #11462 |
@@ -95,6 +103,7 @@ private function prepareNamePrefixSuffixOptions($options, $isOptional = false) | |||
foreach ($options as $value) { | |||
$value = $this->escaper->escapeHtml(trim($value)); | |||
$result[$value] = $value; | |||
$result = array_filter($result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this outside the loop.
Hi @ivanbastos , I am closing this PR now due to inactivity. |
… #17861
Description
When we configure the Customer Name Prefix and leave at the end of the field the separator ";" Magento renders a white field. When we set the option with required is impossible leave the white field so I filter the values and clean the white option to have only the prefix defined
Honestly I believe that is not a bug but only a way to work with Magento. If you simple not ends the options with the separator the problem will not happens but once some users are not familiar with this logic I believe is better filter the options and remove the white spaces
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist