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
Sorry - it is the field_group module. However, last night I switched off proxying to the site and proved to Cloudflare Support that it was NOT a Backdrop issue. After a thorough...
Cloudflare specific advice needed [SOLVED]
@ian I am getting lost what module are you using that is version 1.x-1.6.0 and 1.x-1.7.0 ?
Cloudflare specific advice needed [SOLVED]
I'm also now getting a 403 when trying to access admin/reports/updates - it seems to be Backdrop generated but there is nothing in the Recent Log messages other than my login as admin...
Cloudflare specific advice needed [SOLVED]