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
When looping through custom fields I was trying to automatically set the required attribute based on {{ customField.required }}. It looks like this property has been moved into {{ customField.layoutElement.required }} but the original property still exists and is not being set - it's always false.
Custom field properties. The required property is false, despite the field being set to 'required'
Same field, layoutElement
While I understand that this property has been moved into layoutElement, if the original property remains then should it also honour the required setting of the field for consistency's sake. At least until fully deprecated (if that's the plan) .
Steps to reproduce
Create a custom field and set it to be required
On the front-end loop through the custom fields and use the {{ customField.required }} property to set the required attribute on the field.
Expected behavior
The field should received a required attribute
Actual behavior
The {{ customField.required }} property is always false while the {{ customField.layoutElement.required }} property honours the setting in the CP.
Craft CMS version
5.4.4
PHP version
8.2.18
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered:
What happened?
Description
When looping through custom fields I was trying to automatically set the required attribute based on {{ customField.required }}. It looks like this property has been moved into {{ customField.layoutElement.required }} but the original property still exists and is not being set - it's always false.
Custom field properties. The required property is false, despite the field being set to 'required'
Same field, layoutElement
While I understand that this property has been moved into layoutElement, if the original property remains then should it also honour the required setting of the field for consistency's sake. At least until fully deprecated (if that's the plan) .
Steps to reproduce
Expected behavior
The field should received a required attribute
Actual behavior
The {{ customField.required }} property is always false while the {{ customField.layoutElement.required }} property honours the setting in the CP.
Craft CMS version
5.4.4
PHP version
8.2.18
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: