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.
states.js
requires form items to be wrapped in form-item
.
We have to make sure that class makes it in.
function twitter_bootstrap_form_element(&$variables) {
...
$attributes['class'][] = 'form-item';
Comment | File | Size | Author |
---|---|---|---|
#5 | twitter_bootstrap-form-states-1471106-4.patch | 873 bytes | natted |
Comments
Comment #1
frankbaele CreditAttribution: frankbaele commentedCould you give me more info please
Comment #2
nagiek CreditAttribution: nagiek commentedWhen
states.js
looks for form elements to change, it looks for the input within a.form-item
tag. This theme does not apply the form-item tag uniformly, so states.js breaks.Comment #3
frankbaele CreditAttribution: frankbaele commentedComment #4
jim_at_miramontes CreditAttribution: jim_at_miramontes commentedSubscribe. Are there any updates on this? I'm just getting started on both twitter-bootstrap and states, and would really like them to both work!
FWIW, adding
$attributes['class'][] = 'form-item';
to the _form_element function, just before$output = '<div' . drupal_attributes($attributes) . '>' . "\n";
is so far working nicely for me, but it's early yet...Comment #5
natted CreditAttribution: natted commentedOk, I hope I've done this right... but here is a patch based on suggestion from nagiek and jim_at_miramontes.
In testing, it resolves a problem where my project was using form states and twitter_bootstrap caused them to break.
Please advise if anything further needs to be done or if problems still occur.
Comment #6
natted CreditAttribution: natted commentedComment #7
jim_at_miramontes CreditAttribution: jim_at_miramontes commentedWorks for me...
Comment #8
frankbaele CreditAttribution: frankbaele commentedComment #9
andregriffin CreditAttribution: andregriffin commentedCommitted to Dev
Comment #11
andregriffin CreditAttribution: andregriffin commented