Contacts: remove leading and trailing white-spaces from contact entry fields

Created on 27 Feb 2017  路  8Comments  路  Source: nextcloud/contacts

Expected behavior

The contacts app should remove leading and trailing white-spaces from contact entry fields before they're stored in the database.

Current behavior

The contacts app is currently not removing leading and trailing white-spaces from contact entry fields which causes unexpected address book sorting results.

Steps to reproduce

  1. Open the contacts app
  2. Enter e.g. a Name with leading white-spaces
  3. Check the sorting of the address entries not only in the Contacts app but also e.g. in a hands-free car phone.

Environment

Server Configuration

OS: Linux 3.2.84
Web server: Apache2 2.4.25
Database: MariaDB 5.5.54
PHP version: 5.6.29
Nextcloud version: 11.0.1
Contacts app version: 1.5.3

Client Configuration

Browser: Mozilla Firefox 51.0.1
Operating system: Windows 7

1. to develop enhancement good first issue

Most helpful comment

I have assigned myself to this and will work on it as one of the next PRs for Team Popcorn (RGSoC 2018)

All 8 comments

Why would one insert white-spaces in the first place? :smile:
We'll think about it!

@irgendwie something to add in validate?

sounds good... maybe someone added whitespaces on purpose :man_shrugging:

Damn, wrong topic! Not duplicate, my bad! Too many tabs opened!

I have assigned myself to this and will work on it as one of the next PRs for Team Popcorn (RGSoC 2018)

Hi @skjnldsv and @irgendwie I have problems recreating this issue, I don't have a hands free car app but on the app it appears that trailing white spaces at least from the beginning are removed, is it possible this was fixed else where? Or perhaps I miss something, I am very new to this :) Thank you in advance!

@sleepypioneer I can't reproduce either. Seems to be fixed, maybe our update to the new vcard library.
Adding a space before, and/or after, and triggering a save send the proper data.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RobertZenz picture RobertZenz  路  4Comments

brantje picture brantje  路  5Comments

michaelletzgus picture michaelletzgus  路  5Comments

Peque picture Peque  路  3Comments

jtrees picture jtrees  路  3Comments