backdrop-contrib / insert

Utility that makes inserting images and links to files into text areas much easier.
GNU General Public License v2.0
3 stars 4 forks source link

Insert not working with multiple HTML fields #3

Open jackaponte opened 7 years ago

jackaponte commented 7 years ago

According to README.md, "Insert should work on multiple fields (the last field that was active will receive the file), and with most popular WYSIWYG editors." However, I've found that Insert doesn't work when there's more then one HTML-enabled field on the node add/edit form. No error reports that I've been able to observe!

herbdool commented 7 years ago

@klonos @jlfranklin can you confirm this bug? Interested in fixing? I don't really use this module so not simple for me to test.

klonos commented 7 years ago

I couldn't get it to show the "insert" button even with only a single HTML field 😞 ...something I must be doing wrong:

  1. Edit the post content type.
  2. Edit the image field.
  3. Enabled all options for insert, defaulting to "automatic".
  4. Saved content type.
  5. Create a new post node.
  6. Upload an image -> only "Remove" button; no insert option 😕

I also tried adding a file field and enabling insert for it, adding a second HTML-enabled text field. No joy 😞

jackaponte commented 7 years ago

@klonos, when editing the file or image fields did you make sure that the "Enable insert button" box under the Insert dropdown is checked? It's easy to miss, and without it being checked the Insert button won't appear.

jackaponte commented 7 years ago

I'm observing may two different funky behaviors:

If editing a node that includes a Body field with the Summary field enabled, I can use the Insert button to insert a file into either the Summary or the main Body field; however, if I insert a file into the Summary field, there's no coming back, I can't insert any files into the main Body field after that. The opposite is not true.

On a different content type with multiple HTML-enabled, WYSIWYG-enabled fields, the Insert button appears but does nothing at all; the file isn't inserted into any of the HTML-enabled fields.

On still another content type with one HTML-enabled field with no WYSIWYG and a second with WYSIWYG, if I click in the first WYSIWYG disabled field I can insert images into that field; I can't insert any images into the second WYSIWYG enabled field.

Not sure if those details are at all helpful; let me know if I can provide more helpful specific details!

yorkshire-pudding commented 2 years ago

I've experimented with this. The issue is something to do with https://github.com/backdrop-contrib/insert/blob/1.x-1.x/insert.js

If I have a body with summary or a second text field but keep it plain text then insert seems to work.