Skip to content

[5.x]: Plain text field with handle "sectionId" returns null value after migration from Craft 4 to Craft 5 #15923

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

  1. Spin up Craft 4 project.
  2. Create matrix field and matrix entry.
  3. Create plain text field called "Section Id" with handle "sectionId". Add "Section Id" to matrix entry and template.
    Image
    Image
  4. Add "Section Id" field to entry and set a value for the field.
    Image
  5. Save entry with "Section Id" field value.
  6. Verify in template that "sectionId" handle outputs value as expected on frontend template.
    Image
  7. Migrate site from Craft 4 to Craft 5.
  8. Verify "Section Id" field still exists with handle "sectionId"
    Image
  9. Verify "Section Id" is available on the entry backend and has content saved to the field.
    Image
  10. Verify "Section Id" does NOT render on front end template.
    Image
  11. Navigate back to field in Settings.
  12. Change handle of "sectionId" to "sectionID". Modify entry template to match.
    Image
    Image
  13. Verify data renders on front end template.
    Image

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

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions