Skip to content
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

Spaces at start or end not shown or editable in user list #4480

Closed
alexander-haller opened this issue Jul 19, 2023 · 2 comments
Closed

Spaces at start or end not shown or editable in user list #4480

alexander-haller opened this issue Jul 19, 2023 · 2 comments

Comments

@alexander-haller
Copy link

alexander-haller commented Jul 19, 2023

Detailed description of the problem

If you create a User that contains empty spaces at the start or end of (for example) his Firstname or Lastname the UI will create the user with those spaces (in the database) but will not later show this to you in the UI.

Also because it will not show those empty spaces you can not delete them from the UI directly. You can do the workaround of completely changing the string to something else, save this and then write down the name without the space and save again.

Expected Behavior

Ether disallow empty spaces at the start and end of those strings or make them visible and editable.

Steps to reproduce the behavior

  1. Create a user like " empty_char_at_start_firstname"," empty_char_at_start_and_end_lastname ","emptytest@localhost.local"," empty_char_at_start_firstname empty_char_at_start_and_end_lastname "
    Screenshot_20230719_113438

  2. look at the user in the UI shown (no starting or trailing empty spaces shown)
    Screenshot_20230719_113758

Behavior is also like this if there is more than one space:
" empty_char_at_start_firstname"," empty_ char_at_start_and_end_lastname",emptytest@localhost.local," empty_char_at_start_firstname empty_ char_at_start_and_end_lastname"

What eLabFTW version are you using? Visible in bottom right of a page.

4.7.0

Do you have any idea what may have caused this?

No response

Do you have an idea how to solve the issue?

No response

Additional information

No response

@NicolasCARPi
Copy link
Contributor

What do you mean by:

Also because it will not show those empty spaces you can not delete them from the UI

They can be deleted just fine (in dev version at least).

I have added a trim() function to firstname and lastname for user creation, to remove whitespaces.

@alexander-haller
Copy link
Author

They can be deleted just fine (in dev version at least).

I meant that you can not directly delete them (since you cant even see/select them).
You first need to change the (otherwise correct) username to something else to get rid of them.

NicolasCARPi added a commit that referenced this issue Jul 19, 2023
* hypernext: (99 commits)
  force lock on archive action
  align the tags query param name with other array params
  trim user firstname/lastname on creation from spaces. fix #4480
  remove the custom css rule for 10pt font size in mce body
  add autoresize tinymce plugin with bottom margin
  correctly reload timestamp info/files after timestamp
  fix incorrect selectable detection on scheduler
  add touch() for entities
  invert logic in abstractlinks
  add json export in export menu
  remove unused use
  minor composer bump
  add missing new-apikey-warning i18next translation key
  add ts_balance in /info api response
  improve footer
  add test for bookable_item email target
  add note about who sent the mass email and that it can be replied to
  add Reply-To header to emails sent with mass email feature
  remove phpdoc graph setting
  fix toggle body on links in edit mode
  ...
NicolasCARPi added a commit that referenced this issue Jul 20, 2023
* hypernext: (102 commits)
  update i18n french
  generate bookable elements with Populate
  fix issue with output buffering when downloading big files
  force lock on archive action
  align the tags query param name with other array params
  trim user firstname/lastname on creation from spaces. fix #4480
  remove the custom css rule for 10pt font size in mce body
  add autoresize tinymce plugin with bottom margin
  correctly reload timestamp info/files after timestamp
  fix incorrect selectable detection on scheduler
  add touch() for entities
  invert logic in abstractlinks
  add json export in export menu
  remove unused use
  minor composer bump
  add missing new-apikey-warning i18next translation key
  add ts_balance in /info api response
  improve footer
  add test for bookable_item email target
  add note about who sent the mass email and that it can be replied to
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants