When using other modules utilizing imagefield such as LinkImageField, you get a nasty error because:

function _epsacrop_get_crop_presets() {
  $actions = _epsacrop_get_crop_actions();
  $presets =  array();
  foreach ($actions as $preset) {
    $presets[$preset['presetname']] = $preset['presetname'];
  }

  return $presets;
}

tries looping through a variable which isn't an array. This is because epsacrop doesn't (currently) detect these other fields and no action presets exist.

The attached patch fixes this by simply checking if $presets is not empty, and is an array before looping.

CommentFileSizeAuthor
epsacrop_expecting_array.patch930 bytestseven

Comments

tseven’s picture

I just submitted a patch which should allow epsacrop to work with other modules.

yvmarques’s picture

Hi,

Thanks for the patch, it's now commited in 1.x-dev :)

-- Yvan

yvmarques’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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