Download & Extend

Non displaying dialog window (epsacrop i.c.w. noderelationships)

Project:EPSA Crop - Image Cropping
Version:6.x-1.x-dev
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:epsacrop, EPSACropDialog, modalframe, noderelationships, not a function

Issue Summary

I currently have 2 content types (photoalbum & image) which are connected with a nodereference field. With the Node Relationships module I make the creation of an image Popup. As you can see in attachment this works fine and i can upload an image also like it suppose to work.

When clicking the link 'Manage image crop', the epsacrop dialog won't open. Instead only an empty new browser tab opens.
If i try to create an image content type directly everything works correctly.

Anyone had this problem also? Any suggestions how to fix this?

Tnx in advance.

AttachmentSize
epsacrop.png26.82 KB

Comments

#1

Title:Problem with epsacrop i.c.w. noderelationships» Non displaying dialog window (epsacrop i.c.w. noderelationships)

#2

I have same issue. If you check in firebug or similar tool you'll see a info from firebug console:
$("#EPSACropDialog").dialog is not a function

#3

Try to create imagecache preset with an ordinary crop (IMPORTANT: just crop and nothing more).

#4

This problem occurs because of following function in modalframe module's child.js

/**
* Add target="_new" to all external URLs.
*/
Drupal.modalFrameChild.behaviors.parseLinks = function(context) {
  $('a:not(.modalframe-processed)', context).addClass('modalframe-processed').each(function() {
    // Do not process links that have the class "modalframe-exclude".
    if ($(this).hasClass('modalframe-exclude')) {
      return;
    }
    // Obtain the href attribute of the link.
    var href = $(this).attr('href');
    // Do not process links with an empty href, or that only have the fragment.
    if (!href || href.length <= 0 || href.charAt(0) == '#') {
      return;
    }
    $(this).attr('target', '_new');
  });
};

Just override this js function in your theme js (for example):

/**
* Add target="_new" to all external URLs.
*/
if (Drupal.modalFrameChild) {
  Drupal.modalFrameChild.behaviors.parseLinks = function(context) {
    $('a:not(.modalframe-processed)', context).addClass('modalframe-processed').each(function() {
      // Do not process links that have the class "modalframe-exclude".
      if ($(this).hasClass('modalframe-exclude')) {
        return;
      }
      // Obtain the href attribute of the link.
      var href = $(this).attr('href');
      // Do not process links with an empty href, or that only have the fragment or javascript href (Added by Yauhen Zenko)
      if (!href || href.length <= 0 || href.charAt(0) == '#' || href.indexOf('javascript') == 0) {
        return;
      }
      $(this).attr('target', '_new');
    });
  };
}

With this code all links that use javascript in href would stay the same - target="_new" will not be added.

#5

Hello,
I had the same problem - did you clear your cache ?
I disabled "Optimize Javascript files" in Preferences, and the popup dialog was there

and yes, I heard that having the "libraries" folder in the site/all/ directory could cause some problems too

#6

The trick is to add the class "modalframe-exclude" to the "Manage image crops" link.
I attach a patch for the current stable version, but it would be the same also for the dev release.

AttachmentSize
epsacrop-modalframe.patch 865 bytes

#7

Sorry, I inverted the files... I attach the working patch here

AttachmentSize
epsacrop-modalframe.patch 865 bytes

#8

Status:active» needs review

Hello,

Commited in 6-1.x-dev, thanks for the patch.

-- Yvan

#9

Version:6.x-1.0» 6.x-1.x-dev
Issue tags:+EPSACropDialog, +not a function

Hi all

Thanks for this great module.

I have this problem WITH 6.x-1.x-dev even if I DO NOT use modalframe...
No way to open crop dialog box !
Here is the message in console :
$("#EPSACropDialog").dialog is not a function

My config : jquery update 6.x-2.0-alpha1 + jquery 1.8.4 on Drupal 6.20.
I use the Libraries Module so Jcrop and json2 are in the /sites/all/libraries folder...

I have deactivated javascript aggregation and compression... I have flushed cache about 200 times...
No way to fix-it.
It was running perfectly but I can't identify which upgrade made it crash.
Should I downgrade Jquery ?

Please help ! Thanks !

#10

OK... help yourself !

I have downgraded jquery ui to 1.7.3 and it's looks much better ! : the EPSA crop windows appears...
Got some little problems with background opacity and save button...
...but the solution seems to be her : must use an appropiate version of jquery ui.
Sorry for the post if I should have know this before... It may help some other "newbie" like me ;-)

#11

Hello,

I tried the module with the latest versions of jQuery Update and jQuery UI modules. I can't manage fix the module for higher version if these modules (jQuery Update and jQuery UI) doens't support it.

I already knew that EPSACrop doesn't work with this version of jQuery UI, the only one way to fix it, is to have the rights versions.

Regards,

#12

Status:needs review» fixed

#13

Status:fixed» closed (fixed)

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

#14

Status:closed (fixed)» active

@ratjaune (#10)
Yes, I have some little problems too with background opacity and save button. How did you fix it? Couldn't this be commited without breaking the display in previous jquery versions?
Thanks !

#15

Hi GaëlG,

Can you send me a screenshot with the problem and tell me which jQuery UI and jQuery Update version you're using ?

Thanks,

-- Yvan

#16

Of course ! Nice to see such a fast maintainer. Thanks !

Drupal 6.22
jQuery UI 1.7.3
jQuery Update 1.3.2

with following modules enabled :
jQuery UI 6.x-1.5
jQuery Update 6.x-2.0-alpha1
Modal Frame API 6.x-1.7
Node Relationships 6.x-1.6
Libraries 6.x-1.0

AttachmentSize
Capture.png 155.29 KB

#17

Ok thanks, I see more or less the problem I will check it and come back to you soon as an idea :)

-- Yvan

#18

Thank YOU!

#19

Status:active» needs review

Hi GaëlG,

I found the problem and fixed it in the last 6.x-1.x-dev release (maybe not yet build). Actually the problem was that the structure of jQuery UI 1.7.x folder is different from jQuery UI 1.6.

So I fixed it and here is the patch that was committed.

AttachmentSize
patch_commit_36659e91adc9.patch 1.49 KB

#20

Status:needs review» reviewed & tested by the community

Perfect. I had to apply the patch manually to my 6.x-1.2 version, but it makes epsacrop work for both versions of jQuery. Thanks again.

#21

Status:reviewed & tested by the community» closed (fixed)