Skip to content

[Panel] Users Field Should Save Persistent ID, Not Email Address #1885

@neildaniels

Description

@neildaniels

Describe the bug
We just ran into an unexpected issue today, if you change the email address of a user, pages that had a Users field are no longer linked to the affected user.

I genuinely thought the Users field would save a list of persistent User IDs (i.e. the folder name that contains an individual user's files). If it had done this, renaming an email address wouldn't break existing pages (it breaks now because $field->toUsers() finds no matching email address.

What's Actually Saved in a Content File

What I Would Expect to be Saved

Authors: 

- By4XbnMB

To Reproduce
Steps to reproduce the behavior:

  1. Have a user with an email [email protected] ("Example User")
  2. Go to a page with a Users field, select "Example User"
  3. Change the email address for "Example User" to [email protected]
  4. Attempt to do $field->toUsers() on the original page

Expected behavior
The user should still be accessible.

Kirby Version
3.1.x and 3.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions