Commit fac407cf authored by Wesley Sandra's avatar Wesley Sandra Committed by Wesley Sandra
Browse files

Issue #3283460 by weseze, Rajab Natshah: image_widget_crop styles should never have a height.

parent bf8a3444
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -320,17 +320,15 @@ class DrImageController extends ImageStyleDownloadController {
      $iwc_id = NULL;
    }
    if ($iwc_id) {
      // image_widget_crop styles should never have a height.
      $height = 0;
      if (!$this->moduleHandler()->moduleExists('image_widget_crop')) {
        $error_msg = $this->t('Image_widget_crop module is not active.');
      }
      else {


        if (!$crop_type = \Drupal::entityTypeManager()->getStorage('crop_type')->load($iwc_id)) {
      else if (!$crop_type = \Drupal::entityTypeManager()->getStorage('crop_type')->load($iwc_id)) {
        $error_msg = $this->t('Image_widget_crop type not found.');
      }
    }
    }

    // Try and find a matching image style.
    $requested_dimensions = [0 => $width, 1 => $height];