Download & Extend

doesn't work after the first image upload

Project:Imagefield Crop
Version:6.x-1.0-beta3
Component:Code
Category:bug report
Priority:normal
Assigned:doq
Status:postponed (maintainer needs more info)

Issue Summary

In my installation cropbox preview doesn't work after image is uploaded.

AttachmentSize
imagefield_crop Drupal.settings.imagefield_crop.preview fix.patch1.32 KB

Comments

#1

Status:needs review» needs work

hmm.. interesting..

Can you explain this fix?
I would like to keep js variables within the designated namespace, under Drupal.settings.imagefield_crop - so I will need to understand more of this..

#2

For some reason, when you try to change the Drupal.settings object around line 260, after the image is uploaded for the first time, it isn't successful. I'm not sure how to modify it. What the patch does (successfully) is use a plain old variable instead of trying to modify that object.

#3

here is my take on a patch to fix the same issue.

the problem occurs when a user Removes the image that imagefield_crop was cropping, user uploads a new image, and imagefield_crop loads a second time, via ajax, but doesn't reset the Drupal.settings.imagefield_crop.preview . Running through those steps with the current version of the code results in a javascript error. Either of the two patches (mine or doq's) will fix that, so there is no longer a js error, and the new image Preview works fine.

AttachmentSize
imagefield_crop.js_.patch 1.05 KB

#4

Priority:critical» normal
Status:needs work» reviewed & tested by the community

I can confirm that the patch in #3 works as intended. I was one of the ones who had this exact problem, and Fourtyonederful fixed it. :) The imagefield crop preview is working perfectly again.

#5

I understand your explanations, but I cannot recreate the problem this patch is fixing. Can you explain in more detail which steps to take in order to recreate this *before* applying the patch?

#6

@Senpai - are you still using the module with the patch at #3? Does this fix the problem with the old image remaining on the page when pressing 'remove' and trying to add a new image?

#7

Status:reviewed & tested by the community» postponed (maintainer needs more info)

I am still unclear as to what the bug is. I go to the demo page at http://crop.yhager.com/node/1/edit, click remove, and upload a new image, it crops fine. Then I upload another one, and it also crops fine.
The location and size of the crop box is a bit awkward after replacing the images, but that is quite a minor issue.

nobody click here