Hey there,
I always get this error with the dev-Version on the node/edit - Screen.

I think the line 323 in the module file should be changed into
if ($element['#file'] && strpos($element['#file']->filemime, 'image')) {
from
if ($element['#file'] && $element['#file']->type == 'image') { // old one..

this works for me and the notice is away.. by the way: dsm($element['#file']) contains no "type"..

cheers!

CommentFileSizeAuthor
#3 imagecrop.module-1506682.txt660 bytescangeceiro

Comments

nils.destoop’s picture

What type of imagefield are you using (and d7 version)? When i dsm the element['#file'] . The type property is available.

cangeceiro’s picture

I am also running into this same issue using a standard imagefield and the latest dev

cangeceiro’s picture

StatusFileSize
new660 bytes

attached is a patch that removes the php notice, and checks against the mimetype instead of $element['#file']->type. I assume ->type is added by media module, which would explain why i am seeing this using a standard image field. But even with the media field module, the field could be an image and have a different type since different bundles can be created with the media module, and the machine name is keyed in this field. The patch checks against the mime type instead which should be more reliable in determining the type of field.

nils.destoop’s picture

Status: Needs review » Fixed

Patch has been committed to dev, but changed it a bit.
$element['#file']->type does exist for me on the standard imagefield. Maybe it's gone in latest d7?
Anyway, committed this check to dev.

Status: Fixed » Closed (fixed)

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