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

Editing a staff account results in loss of custom fields #845

Closed
jefft opened this issue Dec 28, 2022 · 2 comments
Closed

Editing a staff account results in loss of custom fields #845

jefft opened this issue Dec 28, 2022 · 2 comments

Comments

@jefft
Copy link
Contributor

jefft commented Dec 28, 2022

There looks to be a nasty bug in 2.32.0+ (not present in 2.31.2) that results in data loss. If a Person has an associated staff account, and you edit that staff account (e.g. to adjust their permissions, or mark them active/inactive), then all that person's custom fields are lost.

To replicate:

  1. Add a custom field if none exists yet. E.g. here I've got a 'MultiCF' field:

image

  1. On a Persons page for someone with an associated staff account, set the custom field. E.g. here the value is 'bar':

image

  1. In Admin -> User Accounts, find the account and 'edit' it. This is the first sign of a problem: the custom field doesn't show, whereas previously (in 2.31.x) it did:

image

  1. Fill in your 'current password' and click 'Update Account'.

  2. View the Person record. You'll note the custom field is gone. The History shows it has been blanked out:

image
image

@jefft
Copy link
Contributor Author

jefft commented Dec 28, 2022

As for the bug cause: I reckon it's the missing custom fields on the edit_user_account form. Jethro 2.31 showed all custom fields. In 2.32 only a handpicked 5 show. Perhaps, when submitted, the edit_user_account code sees "hm, no custom fields. Blank them all!"

The change may have originated in c7301ca where the $fields variable changed from containing all fields, to containing just 5.

@tbar0970
Copy link
Owner

THanks for reporting. Leaving custom fields out of that form was a deliberate change (it all got too long).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants