Reviewed & tested by the community
Project:
CKEditor Link
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Dec 2012 at 17:42 UTC
Updated:
8 Jun 2020 at 12:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
plachHere is a patch skipping language enforcement for nodes not having core language support.
Comment #2
Drupa1ish commentedTodo delete, wrong post
Comment #3
Drupa1ish commentedComment #4
dexx086 commentedDear Mainteners,
when is this patch going to be merged into the public version?
I've applied this patch manually (thx plach) and it works as I expected, but it would be better not to have the patch manually applied but included in the public version. Is there any reason why this patch is not yet accepted?
Regards,
Dexx
Comment #5
plachI guess because no one tried it out and reported success until now :)
If you feel this is ready to be incorporated please set the status of this issue to reviewed and tested by the community (RTBC).
Comment #6
dexx086 commentedI've seen it working only in a very basic situation. Based on that, I wouldn't be brave enough to say it works perfectly for every situation :) So it would be good if other people could verify if this patch works for them too or not.
Comment #7
Ivan Ottinger commentedPatch #1 works for me, thank you. :)
Comment #8
plachTentatively marking RTBC after the feedback provided in #4 and #7.
Comment #9
thelmer commentedPatch #1 works for me, tested on 4 multilang sites with entity translation
Comment #10
matteoagosti commentedPatch #1 works for me too, thank you
Comment #11
punchmonkey commentedPatch #1 is working well for me. Thank you for developing this.
Comment #11.0
punchmonkey commentedUpdated issue summary.
Comment #12
thelmer commentedSee next post ..
Comment #13
thelmer commentedI have attached an updated patch that don't throw warnings like :
"Notice: Undefined property: stdClass::$type in ckeditor_link_ckeditor_link_node_url()"... if the content contains dead links.
Comment #14
maxplus commentedHi,
looks I'm doing something wrong, using
- Entity Translation 7.x-1.0-beta3
- CKEditor Link 7.x-2.3 with patch #13 or #1
- CKEditor 7.x-1.3 (with CKEditor 4.3)
When I type three characters in the autocomplete field, nothing appears when editing a translated node.
When I do the same in de default language, it works.
Anyone any idea what I'm doing wrong?
Thanks
Comment #15
plachIIRC node lookup is always done in the default language as there is no integration with the Title module atm.
Comment #16
thehyperlink commentedWe're using patch from comment #13 in production now for several months; Works very good.
Can someone please commit?
Comment #17
sleitner commentedHere is a patch which solves the autocomplete problem, the correct node path will be returned
Comment #18
sleitner commentedAnother patch which corrects the shown path when reopening the link popup
Comment #19
yazzbe commented#13 worked for me.
#18 provides a languages prefix in the url.
But when creating a link to an entity translated node, I need the url to be 'node/00' and not 'en/node/00', so the url will stay within the same language version. Or am I missing something?
Comment #20
rudins commentedSame patch (#18), correct file path.
Comment #21
anrikun commentedComment #22
rudins commentedI expanded autocomplete query to be able to search translated titles. Similar modifications added to node_revert too.
Merged previous changes into this patch.
Comment #23
mahalo13 commentedI'm Using Version 7.x-2.3 and also with patch #22 the autocomplete in entity translation was not showing the correct Titles in the current language.
I've checked the Query in ckeditor_link_ckeditor_link_node_autocomplete() and made some changes.
For example the search in n.title was there twice but it has only to check if it's in n.title or then in t.title_field_value.
WHERE (n.title LIKE '%TITLE%') AND (n.type IN ('TYPE') AND( (n.title LIKE '%TITLE%') OR (t.title_field_value LIKE '%TITLE%') )is now
WHERE (n.type IN ('TYPE') AND( (n.title LIKE '%TITLE%') OR (t.title_field_value LIKE '%TITLE%') )I also changed the return result for matches. It used to show all translated Titles of the Node in Autocomplete, but in my opinion, there only must show the titles in the current language.
Please feel free to correct me or my patch.
Comment #24
rudins commentedThanks for review and suggestions.
I reviewed my patch again, query is correct. My patch removes line
->condition('n.title', '%' . db_like($string) . '%', 'LIKE')How did you applied patch?
There could be cases where link should point to node other than current language. Maybe we need some global variable to switch.
Comment #25
mahalo13 commented@rudins
Maybe it didn't remove the line because i'm using the 7.x-2.3 Version?!
Comment #26
jdanthinne commented#22 is working fine for me. Would be nice to make a stable release with it.
Comment #27
undertext commentedHere is the same patch as in #22, but without appending language code to node title.
Line
is now just
I think it is obvious that when editor want to add link to the node he do not want to show that langcode after node title (in most cases).
Comment #28
peacog commented#22 works for me too. I prefer to keep the language code that was removed in #27. It adds clarity, and is useful in cases where a node has been translated but its title has not yet been changed.
Comment #29
UnicycleAny chance this patch is going to be merged into the public version?
Comment #30
sleitner commentedIf the i18n_node module is used, the language code is not shown in #22. I added the language code when entity_translation is not installed, but i18n_node.
In my opinion, it would be better so show the language code to prevent mistakes. Sometimes you have two nodes in two similar language versions with the same title, but the body text is different, e.g. german and swiss-german or us-english and british-english .
Comment #31
anrikun commented@Unicycle:
There are plenty of patches here. Which one should actually be committed?
Comment #32
pipicom commented#27 works for me. Thanks undertext!
Comment #33
tunicChanging category to Bug report because module page says: 'Full multilingual support' but this issue is not mentioned.
About current pacthes:
#22 seems to address the issue.
#27 is the same as #22 but not adding language code to the title (just for informative reasons).
#30 is the same as #22 but showing language code even if i18n_module is not installed.
I think the language code appended to title feature must be discussed. If accpeted, #30 is the right patch, if rejected the #22 is the one to go.
I'm not sure about #23, it says that corrects an issue in #22 but #22 is working for other users.
Comment #34
tuwebo commentedHi,
Patch #22 is working for me too. Thanks.
@Note: When using this module in combination with pathologic I'm having some issues (just for the record, if anybody is trying this patch you better disable other modules filters).
Comment #35
gaëlgThere is a problem with the latest patches: they assume that every node title is replaced using the Title module. I have one use case where the title of a node type is untranslatable (person name), whereas other types' titles are translatable. Those nodes can't be linked.
Here's the patch, upon #27.
Comment #36
yazzbe commentedI have applied patch #13 against 7.x-2.4 again.
We are building a large multilingual website with 18 language and having all translated node titles appear in the autocomplete field, doesn't make thing easy to find with many language activated.
Maybe it would be a good idea to make it optional if translated node titles are included in the autocomplete field or not.
What do you think ?
Comment #37
charlesj commented#22 works for me!
Comment #38
mpark commentedHello, this doesnt working, if you have default language different from english and english has a prefix en - then urls become with /en/en path and its wrong.
Comment #39
mpark commentededit, patch working if you disable pathologic module.
Comment #40
knalstaaf commented#30 works perfectly for my i18n-enabled project. I think this patch is more relevant than #22, since it covers i18n-projects as well (thus no extra patching is required for multilingual projects). Modules and patches only covering one language can be quite frustrating and is discouraged by the standards I guess. The language code shown regardless of the fact that the internationalization module is being used doesn't bother me.
EDIT: cheered too early, looking up nodes works, but the output (after saving) doesn't use the url alias. In other words: the CKeditor Link filter is not being honoured (d7.43, php 5.6.2).
Comment #41
adinac commentedI changed the patch from #27 to take into consideration only nodes when joining with the field_data_title_field table:
I noticed this issue because ckeditor_link_ckeditor_link_node_revert() was returning the title of an entity (not a node) with the same id of the node it was searching for.
Comment #42
adinac commentedAdded the language code before the label for autocomplete matches.
Comment #43
stefan.r commentedPatch looks good, including an interdiff with #27 which was RTBC.
I think the only point of contention is whether to add the language code for entity translated nodes or not (see #27, #28, #42) -- people seem to think it's useful, so back to RTBC for #42.
Comment #44
steva1982 commentedHi,
IMHO, the language code is important and adding it before the label for autocomplete can help the editor to create the link. The patch #42would be very useful.
When do you think you will commit it?
Thank you.
Ste
Comment #45
garbo commentedI can confirm that the patch from #42 works. The language prefix in the titles at the autocomplete results are very helpfull. This way a user is not forced to link only nodes in the current language and it helps the user when the titles in both languages are the same or very similar (which could happen with Dutch vs English language).
I would vote for commiting patch #42 into the next release.
Cheers,
Bram.
Comment #46
phjouI encountered the same problem and the patch #42 works perfectly.
Agreed for this patch in the next release, it is written "Full multilingual support" in bold on the main page of the module, so it's quite confusing when it is not working correctly. I thought I missed something in the configuration.
Thanks a lot for your help.
Comment #47
gravisrs commentedPatch #42 doesn't work in quite popular scenario, when one of the languages has empty prefix (no prefix) set.
When you'd like to link to prefixed language from non-prefixed language content, all works fine.
When you'd like to link to non-prefixed language from prefixed one - it will incorrectly add current language prefix.
I believe fix should be somewhere inside ckeditor_link_path_strip_language
My quite dirty hack here:
Comment #48
alfthecat commentedThanks for the patch!
I did run into a problem with pathologic, and I found mpark's and TuWeBo's comments on it.
The site's front-end broke entirely (browser showing connection_reset error) after enabling the ckeditor link filter and returned to normal after disabling it.
Uninstalled pathologic and works as a charm. I'm not sure if its safe to commit this just yet, unsuspecting users could encounter problems when updating.