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

Bug: 'Author' not a reserved handle #2797

Closed
andrewfairlie opened this issue Apr 24, 2018 · 3 comments
Closed

Bug: 'Author' not a reserved handle #2797

andrewfairlie opened this issue Apr 24, 2018 · 3 comments
Assignees
Labels
enhancement improvements to existing features system administration 💼 features related to system administration

Comments

@andrewfairlie
Copy link

andrewfairlie commented Apr 24, 2018

Description

I think author is meant to be a reserved handle but isn't in 3.0.3.1

Steps to reproduce

  1. Create a new field "Author" (in my case it was an Entries field)
  2. Use it in a template and it'll treat it like craft\elements\User

Additional info

  • Craft version: 3.0.3.1
  • PHP version: 7.2
@andrewfairlie andrewfairlie changed the title Bug: You Bug: 'Author' not a reserved handle Apr 24, 2018
@brandonkelly
Copy link
Member

Yeah it’s a little awkward but since author is an entry-specific term, and fields are element agnostic, we decided not to prevent this. Someone might want to add an author field to assets or categories, etc., and that would be perfectly valid. Plus you can still access the field value on entries, via entry.getFieldValue('author').

@angrybrad
Copy link
Member

This will also be fixed when #1524 happens.

@brandonkelly
Copy link
Member

Just got around to solving this for Craft 3.7:

  • Category and tag groups no longer validate if their field layout contains a field called group.
  • Entry types no longer validate if their field layout contains a field called author, section, or type.
  • Volumes no longer validate if their field layout contains a field called folder or volume.
  • The user field layout no longer validates if it contains a field called groups or photo.

A field layout designer on an entry type’s edit page, showing a validation error because “author” is a reserved word

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improvements to existing features system administration 💼 features related to system administration
Projects
None yet
Development

No branches or pull requests

3 participants