Hi,

Insert button works fine in new post form, but it doesn't work in comment form.

I can upload a image, and the Insert button is shown in comment form.
However, nothing happened when I click insert button.

I am using Drupal 7.2.
Please advice.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mindcandyman’s picture

I'm having the same issue as well. It works wonderfully when I create a new node, but does not work in the comments. The button is click-able, but does not actually insert. I am using the newest version of drupal as well and the newest version of MySQL.

quicksketch’s picture

Could you also describe what (if any) WYSIWYGs you are using (both the library and module). Sounds like this is an issue without a WYSIWYG at all currently, right?

mindcandyman’s picture

FileSize
73.32 KB

Double post sorry

mindcandyman’s picture

FileSize
88.74 KB

You are right it is an issue without any WYSIWYG installed as well. I created the site with no WYSIWYG installed and it didn't work at that point. Now I have installed CKeditor though so I'm not sure if that complicates the fix at all. It's strange that it works flawlessly with the node creation but not the comments. The key is in the difference there I think. If any other information is need to help feel free to ask. However, I am, unfortunately, well beyond my depth when it comes to searching the code for inherent issues. This is one of my first forays into drupal so I am relying heavily on tutorials. Gotta love NodeOne!...he helped me get views working perfectly.

This may not help at all, but I thought I would throw it up anyways. The two image fields for the node creation and the comments look different from one another. This may not be able to help, but I thought it might give a more knowledgeable person a clue as to what the difference was on the backend.

The top one is what I see when creating a node and the bottom is when uploading to a comment.

rbayliss’s picture

Status: Active » Needs review
FileSize
905 bytes

This was being limited to the node form specifically in the javascript. Attached patch removes this limitation and makes it work for any form. The unfortunate side effect is that if you have two forms on a page, the insert button could paste into the wrong form if a textarea from the wrong form is selected. Not a big deal IMO. I also added an error message to help the user figure out why the button isn't working if no textarea is selected.

quiptime’s picture

@rbayliss,

your patch #5 is good. Especially the funtion to inform the user when the cursor is not in a text area.

quicksketch’s picture

Status: Needs review » Closed (duplicate)