Problem/Motivation
The following notices are generated when editing content with an image with rotate flag enbled:
Warning: array_unique() expects parameter 1 to be array, string given in Drupal\bootstrap\Utility\Attributes->getClasses() (line 66 of themes/contrib/bootstrap/src/Utility/Attributes.php).
Warning: array_intersect(): Expected parameter 2 to be an array, null given in Drupal\bootstrap\Utility\Attributes->hasClass() (line 100 of themes/contrib/bootstrap/src/Utility/Attributes.php).
Steps to reproduce
- Enable the rotate icon checkbox on any image field.
- Edit content with that image field (make sure the user has 'rotate images' permission)
- The mentioned PHP notices are displayed (if this enabled, ie on dev env.)
Proposed resolution
The problem is located in the function simple_image_rotate_field_widget_multivalue_form_alter(), when is defines a css class for the hidden element this module adds. The class is added as a string, but it should be an array.
- '#attributes' => ['class' => 'rotate'],
+ '#attributes' => ['class' => ['rotate']],
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | simple_image_rotate-3223056-2.patch | 530 bytes | markus_petrux |
Comments
Comment #2
markus_petrux commentedPatch attached.
Comment #3
afagiolitoday applied into current dev
Comment #5
afagioli