Hello,
I am trying to create a canned reply. I wanted to insert a hyperlink however it cannot be inserted as the ‘OK’ button doesn’t work.
Steps to repo:
- make or open an existing canned reply.
- Try to insert a link
- Press ‘OK’
The issue concerns the inability to insert hyperlinks into canned replies due to a bug where the ‘OK’ button fails to work. ondrej reported the problem, noting that the button does not function when attempting to add a link. simon confirmed the bug, identifying a JavaScript error (Uncaught TypeError: Cannot read property 'querySelector' of null) in the d-editor _addText method. vinothkannans explained that the issue arises because the ‘Insert Hyperlink’ button opens a new modal, which conflicts with the existing modal for the canned reply form, as the system does not support multiple modals simultaneously. sam suggested deactivating the feature for canned replies and calendar inserts, and vinothkannans confirmed that the fix has been implemented via a commit in the discourse-canned-replies repository.
Hello,
I am trying to create a canned reply. I wanted to insert a hyperlink however it cannot be inserted as the ‘OK’ button doesn’t work.
Steps to repo:
I can reproduce the issue with the link button for canned replies on https://try.discourse.org/. The error I’m seeing is Uncaught TypeError: Cannot read property 'querySelector' of null. It’s being called from the d-editor _addText method.
Should this be assigned @sam?
We’re rendering add/edit canned reply form in a modal window. When we click the “Insert Hyperlink” button it’s opening the modal window again after replacing the “canned reply” form with the “new hyperlink” form. Globally we don’t have an option in the code to display multiple modals at the same time. That’s why it’s creating the above issue. I think the best solution here is to skip the modal for the “canned reply” form.
This is also happening while inserting the “date and time” from the calendar modal.
I am fine to just give up the feature in canned replies and calendar, just CSS out the broken button.
It’s already done as per the commit below