I was reviewing #4509 and was playing with @indigoxela's PR on my local, trying to conditionally show/hide a warning if webp was added to the list of allowed extensions for an image field instance.
A condition like this, where the value is "static" works fine:
'#states' => array(
'visible' => array(
':input[name="instance[settings][file_extensions]"]' => array('value' => 'png, gif, jpg, jpeg, webp'),
),
),
But the goal is to check the value of the field for any occurrence of webp. Unfortunately, #states doesn't seem to support regex OOTB
With some research, I've found this article: https://evolvingweb.ca/blog/extending-form-api-states-regular-expressions which would allow something like this:
'#states' => array(
'visible' => array(
':input[name="instance[settings][file_extensions]"]' => array('regex' => array('value' => '^.*webp.*$')),
),
),
Recent comments
What, if any, text editor are you using for filtered_html ? There have been some updates to CKEditor (5) but I'm not sure that could cause it. I have tried with a site on 1.35.2 and it...
Formatting Options not sticking
Confirmed Backdrop 1.34.3 is happy without the default text, keeping filtered_html as default format type. Whereas 1.35.2 is not.
Formatting Options not sticking
With default text JSON= { "_config_name": "field.instance.node.insight.body", "field_name": "body", "entity_type": "node", "bundle": "insight", "label": "Main Body", "widget...
Formatting Options not sticking