Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Jan 2011 at 02:01 UTC
Updated:
29 Jul 2014 at 19:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirAlways set issue status to needs review when there is a patch.
Comment #2
mattyoung commentedSimplify a little because
drupal_render()does this:So we can put NULL in '#states' and that will not be processed.
I use
!empty($elements['#states'])instead ofisset($elements['#states'])like the '#ajax' key becuasedrupal_render()uses!empty().Comment #3
kalebheitzman commentedApplied the patch on clean install and the install still works fine. I'm not sure how to actually test the functionality of this patch.
Comment #4
mattyoung commentedYou won't see anything different with this patch unless you use the '#states' on a "checkboxes" form element like this:
Before the patch, clicking on the "Eat all" checkbox does nothing to the "fruits" checkboxes. With the patch, all the checkboxes in "fruits" follow the check state of "eat_all".
Comment #5
berdirMoving to the 8.x queue and tagging for possible backport.
Comment #6
ryan.ryan commentedAlright, just going to post my results here - I'm not exactly sure what was trying to be accomplished. But I think I got it.
Pre patch, the select box did not affect the dependee checkboxes. No matter what I did, they remained. (first screenshot).
After applying the patch, the select box did in fact turn the dependee checkboxes on or off accordingly. (screenshots 2 and 3.)
That is all. :)
Comment #7
ryan.ryan commentedSorry I didn't mention before - I tested the above in FF and Webkit browsers.
Comment #8
star-szrReroll for 8.x.
Comment #10
xjmWas a bot issue.
There is now an 8.x branch of the #states exercise module available:
http://drupal.org/project/1269964/git-instructions
Comment #11
dawehnerThis issue seems to be a duplicate of #994360: #states cannot check/uncheck checkboxes elements. The other one is older, has more comments and even fixes radios.
Comment #12
Garrett Albright commentedI concur that this is a dupe. Closing.