plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Dragging image into wiki pages is broken

Open jywarren opened this issue 7 years ago • 8 comments

I'm having trouble dragging an image onto a wiki edit page; it returns an error on this line of dragdrop.js:

($D.selected).find('#create_progress').eq(0).show();

Uncaught TypeError: Cannot read property 'find' of undefined

I wonder if $D.selected was affected somehow? This is the kind of thing a system test (#5316) will help prevent!

Noting this could be linked to #5229

jywarren avatar May 02 '19 17:05 jywarren

Yes! It's the same as this: https://github.com/publiclab/plots2/issues/5229#issuecomment-481370671

jywarren avatar May 02 '19 22:05 jywarren

I'm currently unable to click to upload or drag an image onto a wiki page. I'm not sure if it's related. I'm not getting an error, just no response no matter how long I let the webpage sit open and "think" about it.

publiclab-mimi avatar May 07 '19 16:05 publiclab-mimi

Same issue here on /air-quality

steviepubliclab avatar May 10 '19 15:05 steviepubliclab

I also tried this post clearing-cache, in a different browser, and on a different computer. Still no image uploading working for me.

On May 10, 2019, at 10:02 AM, Stevie [email protected] wrote:

Same issue here on /air-quality

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/5650#issuecomment-491320842, or mute the thread https://github.com/notifications/unsubscribe-auth/ALUKWT6MJCUVOPHAPUAEDH3PUWE77ANCNFSM4HKB2NQA.

publiclab-mimi avatar May 10 '19 15:05 publiclab-mimi

This was fixed in #5657 for comment image uploading, but the fix didn't apply to wiki page image upload. Checking why now; I believe it is failing on $E.wrap in:

  // wraps currently selected text in textarea with strings a and b
  wrap: function(a,b,args) {
    this.refresh();
    var len = $E.textarea.val().length;

That's here: https://github.com/publiclab/plots2/blob/a3e40c5cb20e94653de20a74e0ac9553c87f0d3a/app/assets/javascripts/editor.js#L43

It's initialized here:

https://github.com/publiclab/plots2/blob/a3e40c5cb20e94653de20a74e0ac9553c87f0d3a/app/views/editor/_editor.html.erb#L39

jywarren avatar May 10 '19 18:05 jywarren

Yes!!! This changed, re-assigning $E.textarea to fix reply-to-comment functionality:

https://github.com/publiclab/plots2/pull/5321/files#diff-fd61d47ff16a49707d50fa5f9ae7c5f5R32

We need to make an exemption for wiki image upload.

jywarren avatar May 10 '19 18:05 jywarren

Filed a fix, which I tested, at #5703!

jywarren avatar May 10 '19 18:05 jywarren

Thanks, all!

jywarren avatar May 10 '19 18:05 jywarren