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.
If the form disabled, or one action button is disabled, grouping actions to dropbutton is clearing current disabled state and form become submittable.
Steps to reproduce
1) Create some content type
2) create content of this type
3) Write a module with hook_form_alter() and alter the some node form with $form['#disabled'] = TRUE;
4) go to the Edit page of created content,
5) see that actions are not disabled and form is submittable.
Comments
Comment #2
andypostfixes should go to current dev first
Comment #3
ayan911 CreditAttribution: ayan911 at Novatree commentedI think there is something wrong with your code. To disable a form field, you should try $form['field_name']['#disabled']=TRUE. I tried this code, it is working fine.
Comment #4
ayan911 CreditAttribution: ayan911 at Novatree commentedComment #5
LoMo CreditAttribution: LoMo as a volunteer commentedWhat ayan911 says is true, afaik. You wouldn't ever set a whole form with ['#disabled']. (If you wanted to do that, you could loop over the form elements and set them all to ['#disabled'] .)
I hesitate to be the guy to set this issue to "Closed (works as designed)", but I don't think that the example code here demonstrates any kind of bug (at least not one in Drupal core).
Comment #16
borisson_Thanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.
Like @LoMo, I think this is incorrect api usage.
If anyone can provide complete steps to reproduce the issue (starting from "Install Drupal core"), document those steps in the issue summary and set the issue status back to "Active".
Thanks!