Hi,

I have a small problem with this great module which seems to differ a bit from the other similar issues posted here.

I can use the crop feature fine the very first time I upload an image via file field (screenshot 1).
When I try to edit this image though, everything seems to be broken (screenshot 2):

Neither is the correct (cropped) image shown, nor can I crop the original image again. The only way to correct this is to start over again by deleting the image and re-upload it. Even in this case though, the first image will be shown after deletion until a new one is actually uploaded (screenshot 3).

Does anybody have a similar issue and knows how to correct it?
Thanks a lot in advance!

CommentFileSizeAuthor
3.png23.74 KBGolem07
2.png20.33 KBGolem07
1.png377.16 KBGolem07

Comments

yhager’s picture

Are there any javascript errors on the page while screenshot 2 is shown? You can check the javascript console or firebug if you have it installed (and you should!)

Golem07’s picture

Thanks yhager for the quick reply.

Not sure if i looked in the right place. But in firebug under "console->errors" it shows nothing during all of the above steps. Is this the one you meant?

yhager’s picture

Seems like you looked in the right place, but from the error description it sounds like a javascript error.

Can you try and use a default theme? or maybe disable a few modules? just so we narrow it down with which component imagefield_crop is misbehaving.

Michsk’s picture

Ok i got the same thing with dev.

Firebug:
Fout: jQuery is not defined
File: http://##.nl/user/1/edit/profiel
Rule: 425

Here's something going wrong:
<!-- file not found: --><script type="text/javascript">jQuery.extend(Drupal.settings.imagefield_crop, { "edit-field-profiel-afbeelding-1": { "box": { "ratio": 1.33333333333, "box_width": 500, "box_height": 500 }, "minimum": { "width": "200", "height": "150" }, "preview": "" } });</script></div></div>

This is the first impression. Nothing tested or altered yet. I have the field in a group and use vertical tabs. Might be something with that combination. Will report when i know more.

Michsk’s picture

As expected.

When removing the field from the group (fieldet). It shows as it should. So there is a bug with this module and groups (fieldsets).

Michsk’s picture

Ok the jquery is undefined error is because i have $scripts at the bottom. So that is another thing in this module. You should use drupal_add_js consistant.

yhager’s picture

> You should use drupal_add_js consistant

Can you elaborate?

Michsk’s picture

yhager: I tried using drupal_add_js() but that doesnt seem to do it since i cant get to call the argument when a 'another field' is added. Guess that is also why your using

and not drupal_add_js(). This is something that will need to be investigated.
urbanbricks’s picture

Subscribing. Same issue with editing node after successful cropping, also using fieldsets with vertical tabs for node editing organization.

takki’s picture

Got the some problem, not using fieldsets. Image looks fine the first time but after node edit something goes wrong.

guigui_nyc’s picture

I just had the issue too. I doubt it's going to be a very common problem but I was having issue with my CDN script (we sync our images to Amazon S3 using the Drupal CDN module). New images were not syncing and because of that the imagecrop was only working at the node creation.

menesisz’s picture

Subscribing. Same issue with the rc2 and dev versions. I am using fieldsets, Vertical tabs and Panels.

Sinan Erdem’s picture

sub

open social’s picture

I have debugged it to imagefield_Crop.js

on line 21: onChange: function(c)

in a normal situation c is filled with data in the vertical tabs situation it is empty.

I am searching for a fix, I am not that good in jquery, will see what I can do

open social’s picture

okay, managed to show it: but not a fix right now,

if you comment out in vertical_tabs.js
// Activate the first tab.
//$('fieldset.vertical-tabs-pane').hide();

it will load. so it has to do something with being hided while loading

JamesK’s picture

Status: Active » Closed (duplicate)

Marking as duplicate of #719714: Collapsed fieldgroups break crop area display. where work is progressing on solutions to this.