Open
Description
What happened?
Description
Plain text field named "Section Id" with handle "sectionId" does not render input data from CMS backend inside rendered template. This previously worked when my project was running Craft 4, but returns a null value after migrating project to Craft 5. Appears to be a potential conflict with a protected handle in the Craft 5 Class reference on entries. Changing handle of field to "sectionID" works and bypasses this issue.
Steps to reproduce
- Spin up Craft 4 project.
- Create matrix field and matrix entry.
- Create plain text field called "Section Id" with handle "sectionId". Add "Section Id" to matrix entry and template.
- Add "Section Id" field to entry and set a value for the field.
- Save entry with "Section Id" field value.
- Verify in template that "sectionId" handle outputs value as expected on frontend template.
- Migrate site from Craft 4 to Craft 5.
- Verify "Section Id" field still exists with handle "sectionId"
- Verify "Section Id" is available on the entry backend and has content saved to the field.
- Verify "Section Id" does NOT render on front end template.
- Navigate back to field in Settings.
- Change handle of "sectionId" to "sectionID". Modify entry template to match.
- Verify data renders on front end template.
Expected behavior
For Section Id field with handle "sectionId" to render entered value on backend on front end template.
Actual behavior
Section Id field with handle "sectionId" returns with null value and does not render on front end template.
Craft CMS version
5.4.8
PHP version
8.2
Operating system and version
MacOS Sequoia 15.0.1
Database type and version
mariadb:10.5
Image driver and version
No response
Installed plugins and versions
- CKEditor by Pixel & Tonic. v4.2.0
- Embedded Assets by Spicy Web. v5.1.2
- SEO by Ether Creative. v5.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment