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

andyceo created an issue. See original summary.

andypost’s picture

Version: 8.2.7 » 8.4.x-dev

fixes should go to current dev first

ayan911’s picture

I 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.

ayan911’s picture

Status: Active » Needs review
LoMo’s picture

What 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).