Skip to content

[4.x]: reserved handles should include Account Status handles #13579

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

Closed
Liv-Tarot opened this issue Aug 18, 2023 · 2 comments
Closed

[4.x]: reserved handles should include Account Status handles #13579

Liv-Tarot opened this issue Aug 18, 2023 · 2 comments
Assignees

Comments

@Liv-Tarot
Copy link

What happened?

Description

The Account Status handles are not included in the list of reserved handles (found in cms/src/base/Field.php), which causes issues when creating new fields.

Steps to reproduce

  1. Use any of the account status handles ("Active", "Pending", "Suspended", "Locked", "Inactive") when creating a new field handle.
  2. No error pops up to warn the dev that these cannot be used, they are able to be created and used throughout the site.

Expected behavior

They should not be able to be used as field names since they reference specific user attributes that are hard coded into the CMS.

Actual behavior

The fields work as intended by the dev in most of the CMS, but issues arise when these field names are referenced in relation to account holders. At that point (when referencing users), they work as intended by the CMS (referencing the account status) instead of as intended by the dev.

Craft CMS version

craft4

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@brandonkelly brandonkelly self-assigned this Aug 20, 2023
brandonkelly added a commit that referenced this issue Aug 20, 2023
@brandonkelly
Copy link
Member

Just added the following to the list of reserved user field handles, for Craft 4.5:

  • active
  • addresses
  • admin
  • email
  • friendlyName
  • locked
  • name
  • password
  • pending
  • suspended
  • username

(You’ll still be able to create custom fields with those handles; you just won’t be allowed to use them within the user field layout.)

@brandonkelly
Copy link
Member

Craft 4.5.0 is out with that change.

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