You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Hi, thanks for getting in touch and clear replication steps!
This happens in v5 because matrix blocks are now entries; all entries have a sectionId property, which, for the nested entries (like matrix “blocks”), is null. Renaming that handle is the way to go. I just raised a PR to make the sectionId field handle reserved in the context of an Entry Type.
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
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
The text was updated successfully, but these errors were encountered: