When an image crop field is added to a portion of a content type that is not displayed by default (for example, in a collapsed fieldset or a field group tab), the crop widget does not display when the field is displayed.
It appears this issue was caused by an outdated version of jCrop bundled with the module. I attached a diff that updates jCrop to the latest version (which appears to have fixed the issue).
Original Post:
I have 2 or more "images with croping fields" to display into a form for creating content.
- 2 images with cropping fields displayed into the same vertical or horzontal or accordion tab : OK
- 1 image with cropping field in one / the other into the second division : NOT ok (cropping zone not displayed, impossible to move the cropping zone, etc...)
???
Comment | File | Size | Author |
---|---|---|---|
#13 | imagefield_crop-not_displayed_collapsed-1301502-13.patch | 290.54 KB | likewhoa |
#10 | imagefield_crop-not_displayed_collapsed-1301502-10.patch | 293.02 KB | sammarks15 |
#5 | imagefield_crop_no_problems_tab2.png | 89.3 KB | Stalski |
Comments
Comment #1
webmestre CreditAttribution: webmestre commentedI noticed that
- "images with cropping" fields displayed in 1st tab are OK
- "images with cropping" fields displayed in 2nd tab are NOT ok
Even if I add a custom css class name to each.
MY ANALYSIS about the problem : if an "image with cropping" field is displayed into the 2nd or further tab, the display is bad.
Other element noticed :
When 3 tabs displayed :
- 1st with "image with cropping" field : OK
- 2nd with texts and others fields (no image) : OK
- 3rd with "image with cropping" field : NOT ok
=> Impossible to correctly display "image with cropping" fields if not in 1st position. :-(((
Comment #2
Stalski CreditAttribution: Stalski commentedWe will need more info. What's a cropping field.
Isn't this a contradictory?
Comment #3
webmestre CreditAttribution: webmestre commentedHello,
thanks for helping.
The Drupal module is here http://drupal.org/project/imagefield_crop
When testing this field, try to combine and overall to put those fields not into the 1st tab (that's OK) but in second or further tab. That's the meaning of my previous post.
Comment #4
Stalski CreditAttribution: Stalski commentedThx for the input. I must say this gets minor priority for now. You can always post a patch to speed things up, when patches are submitted we will review it asap and push it to git.
Anyone up for it?
Comment #5
Stalski CreditAttribution: Stalski commentedI tried this with version 7.x-1.x and 7.x-2.x of imagefield_crop and I did not have any problem what so ever. Screenshot is attached.
Comment #6
Stalski CreditAttribution: Stalski commentedI was able to reproduce this error, but I can't get it working in the root of the form nor the first vertical tab pane.
Comment #7
webmestre CreditAttribution: webmestre commentedHello,
when trying again in a new website, if the tab or the div containing the cropped image is collapsed, the image is not shown as cropped. The cropping zone and the original image are not displayed.
A pity because I really need this module.
Comment #8
nils.destoop CreditAttribution: nils.destoop commentedI can confirm your issue.
- Set settings from a div fieldgroup to open: the cropping toolbox works
- Set settings from a div fieldgroup to collapsed: the cropping toolbox breaks
This is a js issue for imagefield_crop, as the rendering is done on the same way.
Comment #9
webmestre CreditAttribution: webmestre commented@zuuperman : I confirm your analyse to be good.
A way to fix the problem ?
Comment #10
sammarks15 CreditAttribution: sammarks15 commentedI apologize for bringing this issue back up, but I discovered the same issue. It appears that when you use imagefield_crop in conjunction with field_group, the crop box doesn't display at all when it's in a portion of the page that isn't displayed by default (as in, you have to click on a tab or expand an accordion to get it to display).
I solved the issue by simply updating jCrop to the latest version (0.9.12 instead of 0.9.9).
I've attached a patch with the changes, updated the title for clarity, and changed the active version to 7.x-2.0 (because that's where I found the bug and tested the changes). I've updated the priority to Major since this is a pretty significant issue.
Comment #11
sammarks15 CreditAttribution: sammarks15 commentedUpdate description for clarity.
Comment #12
welly CreditAttribution: welly commentedJust confirming the patch above (#10) is resolving the same issue that I was having.
Comment #13
likewhoa CreditAttribution: likewhoa commentedre-rolled patch against 2.x branch.