We've had reports that the LinkIt button will not trigger the modal popup. We've also received this error
TypeError: undefined is not an object (evaluating 'Drupal.settings.linkit.fields[editor.id]')
It's pretty easy to replicate, and the issue might be in the root of the WYSIWYG module.
- Create a new piece of content
- Change the body field's text filter to panopoly_html_text and add some demo text.
- Save the node.
- Edit the node you just saved
- Change the body field's text filter to panopoly_wysiwyg_text
- Attempt to use the LinkIt button
- Come up empty handed, find error in console.
At first I figured this to be a WYSIWYG module bug. But after typing out the reproduction steps and reading the error, I think it's within LinkIt itself. WYSIWYG is properly loading the JS files, but on behaviors attach the settings aren't being populated.
Note: I posted the initial issue here rather than LinkIt because it was discovered using Panopoly. Not 100% sure it is LinkIt and not WYSIWYG. People will be more prone to file the report here if they discover it versus the other contirb modules.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | panopoly_wysiwyg-2460217-4-linkit-text-format.patch | 488 bytes | mcrittenden |
Comments
Comment #1
mcrittenden commentedThis seems to be due to linkit_pre_render_editor_element() only caring about which text format is active when initially loading the page, and ignoring the change when you manually change it (from HTML to WYSIWYG). Still not sure if it's a linkit bug or a WYSIWYG bug though. Will dig in a bit more.
Comment #2
mcrittenden commentedDupe of #2115763: Linkit editor button errors out after switching WYSIWYG text format against Linkit. Will be posting a patch there shortly.
Comment #3
mglamanThen we should patch Panopoly to use the patch.
Comment #4
mcrittenden commentedCool, here's a patch for panopoly_wysiwyg which brings in the patch from #2115763.
Comment #5
mcrittenden commentedComment #6
dsnopekThanks, @mcrittenden! You patch works in my testing. :-) Committed!
Comment #9
mcrittenden commentedTo close the loop, the patch was committed to Linkit. #2115763: Linkit editor button errors out after switching WYSIWYG text format