doesn't work after the first image upload
doq - April 6, 2009 - 14:27
| Project: | Imagefield Crop |
| Version: | 6.x-1.0-beta3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | doq |
| Status: | reviewed & tested by the community |
Description
In my installation cropbox preview doesn't work after image is uploaded.
| Attachment | Size |
|---|---|
| imagefield_crop Drupal.settings.imagefield_crop.preview fix.patch | 1.32 KB |

#1
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.
#4
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?