Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Radios are currently not supported.
As per documentation:
When referencing select lists and radio buttons in remote conditions, a 'value' condition must be used:
'#states' => array( // Show the settings if 'bar' has been selected for 'foo'. 'visible' => array( ':input[name="foo"]' => array('value' => 'bar'), ), ),
Comment | File | Size | Author |
---|---|---|---|
#10 | conditional_fields-radio-support-widget.patch | 3.2 KB | zrashevskaya |
| |||
#8 | conditional_fields-radio-support-fixed-tests.patch | 2.41 KB | zrashevskaya |
| |||
#2 | conditional_fields-radio-support-2830995-2.patch | 2.4 KB | zerolab |
Comments
Comment #2
zerolab CreditAttribution: zerolab at Torchbox for The Chartered Society of Physiotherapy commentedAttaching a patch that supports
'#type' => 'radio'
.I don't think we need to support radios as a separate type as it uses 'radio' for each element internally.
Comment #3
itsekhmistro CreditAttribution: itsekhmistro at Adyax commentedThank you for the patch. Looks great for me.
It would be also great to have a Browser test for it.
Comment #4
itsekhmistro CreditAttribution: itsekhmistro at Adyax commentedComment #5
itsekhmistro CreditAttribution: itsekhmistro at Adyax commentedUpdating status to recheck current tests.
Comment #6
itsekhmistro CreditAttribution: itsekhmistro at Adyax commentedStrange but tests are failing within this patch.
Need to look into details later.
Comment #7
zrashevskaya CreditAttribution: zrashevskaya commentedMade some changes to the patch. Tests are working correctly now.
Comment #8
zrashevskaya CreditAttribution: zrashevskaya commentedComment #9
drholera CreditAttribution: drholera at Adyax commentedComment #10
zrashevskaya CreditAttribution: zrashevskaya commentedAdded widget functionality to radio handler.
Comment #11
Topplestack CreditAttribution: Topplestack commentedUnable to apply patch #10
Warning: require(/var/www/bfas-vm/tnr/web/modules/contrib/conditional_fields/src/Form/ConditionalFieldEditFormTab.php): failed to open stream: No such file or directory in require() (line 110 of /var/www/bfas-vm/tnr/vendor/symfony/class-loader/ApcClassLoader.php).
require() (Line: 110)
Symfony\Component\ClassLoader\ApcClassLoader->loadClass('Drupal\conditional_fields\Form\ConditionalFieldEditFormTab')
spl_autoload_call('Drupal\conditional_fields\Form\ConditionalFieldEditFormTab')
class_exists('\Drupal\conditional_fields\Form\ConditionalFieldEditFormTab') (Line: 23)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\Drupal\conditional_fields\Form\ConditionalFieldEditFormTab') (Line: 47)
Drupal\Core\Controller\HtmlFormController->getFormObject(Object, '\Drupal\conditional_fields\Form\ConditionalFieldEditFormTab') (Line: 59)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment #12
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedWas fixed in the last release(2017-Apr-07). Can someone check it, please?
Comment #13
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedComment #14
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedComment #15
ChristopheDG CreditAttribution: ChristopheDG commentedRadio buttons are indeed supported now for node entities (not for user entities).