- Issue created by @swirt
If I create a custom validator for a checkbox field and I try to set the error path to that field, a fragment link gets generated to the field, but it does not work because the id does not exist.
Example:
Create a field 'field_show_banner';
Create validator for the entity and specify the error path to the field
// Multiple errors should go on the checkbox.
$field_error_path = 'field_show_banner';
There validator works and creates a message that says " 1 error has been found: Display a banner alert on this facility"
but with a link around the title of the field. But the link is incorrect. It looks like
<a href="#edit-field-show-banner">Display a banner alert on this facility</a>
The problem is there is no id of `edit-field-show-banner` so the link does not serve its function to jump to the error.
The closest ids are
edit-field-show-banner-value
edit-field-show-banner-wrapper
Setting the path by hand can not be set to include value or wrapper because then no link gets rendered
$field_error_path = 'field_show_banner'; // Results in link with non-existent id.
$field_error_path = 'field_show_banner-value'; // No link generated.
$field_error_path = 'field_show_banner_value'; // No link generated
Either
Add the field id to the output field or make the error link point the field-name-value.
Active
11.0 π₯
Last updated