Magento2: Customer First and Last names not being trimmed of leading and trailing spaces on save.

Created on 3 Aug 2017  路  5Comments  路  Source: magento/magento2

When you create a new contact, if there is a leading or trailing space with no characters after, those are not being trimmed.

Names should be saved with no trailing/leading spaces as this breaks many search tools.

Preconditions


  1. Magento 2.1.3
  2. php 7
  3. MySQL (hosted, not sure of the version)

Steps to reproduce

  1. Create a new customer from the Customers > All Customers > Create New Customer window
  2. Create First name: "John " Last name: " Doe ", add a fake email address.
  3. Click save
  4. Search and edit the contact "John Doe "
  5. Take note that the spaces are saved in the users first and last names.

Expected result

  1. First, Middle and Last names should have and leading and trailing spaces removed on save.

Actual result

  1. Leading/Trailing spaces are left in the names of the customer.
Fixed in 2.2.x Fixed in 2.3.x Clear Description Confirmed Format is valid Ready for Work bug report

All 5 comments

@spyrule thank you for your bug report.
We've created internal ticket MAGETWO-75491 to track progress on the issue.

I'll take a look at this

Hi @stevenvdp could you please accept the invitation to join Magento team on the GitHub?

Hi @spyrule. Thank you for your report.
The issue has been fixed in magento/magento2#12964 by @wardcapp in 2.2-develop branch
Related commit(s):

  • 207fdb030ea15b670ee356e0fc6d64168f991dec
  • 2a23a945d0dc40a295ecf679d84c1356a8c27a1c
  • 1a77bfc9244de2537dfcddf9d1295ceca7a8bd5d

The fix will be available with the upcoming patch release.

Hi @spyrule. Thank you for your report.
The issue has been fixed in magento/magento2#13012 by @wardcapp in 2.3-develop branch
Related commit(s):

  • e8dad7a12430901ca26de6506cda8261453442dd
  • 9a456957cdc5bb5b3133a32d246b771e189e0a5f
  • 03f250ae5155c9f473fb68de473a87acaf343042

The fix will be available with the upcoming patch release.

Was this page helpful?
0 / 5 - 0 ratings