I'm getting this error when I click manage image crops and the windows open.

Error on load : 'undefined' is not an object (evaluating '$('#edit-epsacropcoords').val().length')

It then fails to load the image. Any ideas?

Comments

jphelan’s picture

I found the issue, the id of my textarea is edit-epsacropcoords-1 not edit-epsacropcoords. Any Idea how that could have happened? It worked for months and all of a sudden stopped with this error. I fixed it buy editing line 50 of epsacrop.js and changing the id being referenced.

if($('#edit-epsacropcoords').val().length > 0 && Drupal.EPSACrop.init == false)

<div id="edit-epsacropcoords-wrapper">
  <div class="form-item" id="edit-epsacropcoords-1-wrapper">
    <div class="resizable-textarea">
      <span><textarea cols="60" rows="5" name="epsacropcoords" id="edit-epsacropcoords-1" class="form-textarea resizable textarea-processed"></textarea>   
      <div class="grippie" style="margin-right: 0px; "></div></span></div>
    </div>
</div>
jphelan’s picture

If anyone else runs into this issue you'll need to change epsacrop.js in two other places as well.

Line 51
Drupal.EPSACrop.presets = eval('(' + $('#edit-epsacropcoords').val() + ')');

Line 15
$('#edit-epsacropcoords').val(JSON.stringify(Drupal.EPSACrop.presets));

yvmarques’s picture

Status: Active » Postponed (maintainer needs more info)

Hi,

If you've it, it means that you've twice a node form on the same page.

Is it the case ?

-- Yvan

jphelan’s picture

No, I only have one image field on the node type, it that's what you mean.

sebas5384’s picture

Same problem over here :(

I cant understand how this happened all of a sudden.

yvmarques’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (won't fix)