HUH, this can really shoot you in the knee:
* edit a node that has a textformat without linkit support (or without wysiwyg)
* switch to a textformat with wysiwyg linkit button
* select text and click linkit button
expected: linkit dialog
result: Alert box "Could not fild linkit profile"
Saving the node with the text format and re-editing worksaround the issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | linkit-2115763-18-text-format-switching.patch | 5.75 KB | mcrittenden |
| #12 | 2115763-12-linkit_missing_profile_format.patch | 603 bytes | fabianvdbor |
| #6 | 2115763-6-linkit_missing_profile_format.patch | 770 bytes | SebCorbin |
| #4 | 2115763-4-linkit_missing_profile_format.patch | 527 bytes | SebCorbin |
Comments
Comment #1
geek-merlinWhat i missed for years: *Many thanks for this great module!!*
;-)
Comment #2
geek-merlinSome research shows the flaw lies here. I think to support textformat switching JS settings must have the whole array textformat => linkit-profile, not just the linkit profile for the original textformat.
Comment #3
anonThanks for your appreciation.
This issue is confirmed.
Tho I don't have any ideas on how to solve it now.
The problem is that only the base element is sent to linkit_pre_render_editor_element().
and if that field doesn't have a profile assigned to itself, we just skip the rest.
When switching between text formats in the select list, it is only js stuff going on, and we can't add our settings then.
Comment #4
SebCorbin commentedHere's a possible patch that solve a similar problem
Comment #5
jrabeemer commentedI can confirm this "bug". If you have "Filtered" and "Full HTML" enabled and toggle that filter on a new node @ /node/add/XXXXX, Linkit will fail. The enabled filter type where Linkit is configured must be set on the node, by default or by saving the node with that type, for it to work.
Comment #6
SebCorbin commentedUpdated patch fixing notice when no $element['value']['#id'] is set
Comment #7
aasarava commented#6 works to fix the problem with the linkit button not opening a popup at all (#2124127). Thanks!(Edit: Can't repeat this, so it was perhaps flushing cache or reinstalling the module that fixed that problem.)I'm now trying to apply #6 to the latest dev and now it's not allowing the Linkit dialog to pop open at all. With the patch applied, I get the dreaded "Could not find the Linkit profile" alert for any input format.
Comment #8
anonComment #9
askibinski commentedFYI: I believe this issue also occurs on the core Drupal "body-summary" field.
Comment #10
anonThe patch in #6 doesn't solves the problem.
Comment #11
toby wild commentedI can confirm Anon's comment.
Patch #6 doesn't solve the problem in linkit-7.x-3.0 or linkit-7.x-3.1
Comment #12
fabianvdbor commentedI have a patch that solves the problem in the by linkit-7.x-3.2.
Comment #13
askibinski commentedrelated:
#1912780: Enable linkit for Long text and summary fields
(same js error but different cause)
Comment #14
askibinski commentededit: deleted double post (drupal.org was down)
Comment #15
anonThe patch in #12 doesn't solved the real problem. See #2319721: Wrong element id when it is not the default value
Comment #17
mcrittenden commentedComment #18
mcrittenden commentedHere's a patch which, for editor/format-based Linkit profiles (as opposed to field-based Linkit profiles), rethinks things to be based on format rather than on element, so that when the format for any given element is switched, it just looks up the Linkit profile for the new format and uses that.
Note that this has been tested more thoroughly on WYSIWYG/TinyMCE than it has on WYSIWYG/CKEditor or CKEditor module.
Comment #19
dsnopekThe patch in #18 works in my testing! We're going to start using this in Panopoly soon.
Comment #22
hnln commented#18 works for me 2. For me the linkit button was working in ckeditor for non fields (custom forms, ...), but got js errors when trying to use on body or long text fields with a linkit associated wysiwyg profile. Patch fixed that.
Comment #24
anonThanks for all the hard work on this one. I really appreciate it. This is now committed to the 7.x-dev. Thanks again.