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

  1. Enable the rotate icon checkbox on any image field.
  2. Edit content with that image field (make sure the user has 'rotate images' permission)
  3. 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']],
CommentFileSizeAuthor
#2 simple_image_rotate-3223056-2.patch530 bytesmarkus_petrux

Comments

markus_petrux created an issue. See original summary.

markus_petrux’s picture

Status: Active » Needs review
StatusFileSize
new530 bytes

Patch attached.

afagioli’s picture

today applied into current dev

  • afagioli committed 94e2400 on 2.1.x
    fix #3186522, #3203735, #3223056, #3255089
    
afagioli’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.