Hi,
When I create a link without the domain (http://www.example.org/) to an internal file (CCK filefield) into the site, ckeditor_link seems to add the language prefix, which makes the link false.
In the body of a node, I create a link to "/sites/www.example.org/files/documents/example.pdf", without "http://www.example.org" at the beginning. When I view the node in French (fr), it gives me a link to "http://www.example.org/fr/sites/www.example.org/files/documents/example.pdf" (see the "fr") instead of "http://www.example.org/sites/www.example.org/files/documents/example.pdf". When I see this node in English, without language prefix, the link is fine without any language prefix.
When I disable the module ckeditor_link and clear the cache, the links are fine in both language, they don't have any language prefix. This is why I suspect this module to add the language prefix.
Any idea?
Thanks
Comments
Comment #1
anrikun CreditAttribution: anrikun commentedYou are right, this is a bug of the filter part!
Will try to fix it ASAP.
Thanks a lot for reporting this!
Comment #2
anrikun CreditAttribution: anrikun commentedThis is now fixed in 6.x-2.x-dev.
J0nathan, can you please confirm that it works?
Comment #3
j0nathan CreditAttribution: j0nathan commentedHi anrikun,
I confirm this is resolved with 6.x-2.x-dev.
Thank you very much!
Comment #4
anrikun CreditAttribution: anrikun commentedThanks!
This now needs to be ported to 7.x-2.x.
Comment #5
anrikun CreditAttribution: anrikun commentedPorted to 7.x-2.x-dev
Comment #6
jlnknz CreditAttribution: jlnknz commentedHello,
I think that version 6.x-1.2 was behaving correctly. Do you confirm that this issue is a regression?
Anyway many thanks for your work.
Best regards.
Comment #7
anrikun CreditAttribution: anrikun commentedThis issue was a bug but I don't know if we can say it was a regression: as 6.x-1.x supported only node paths, file paths were just ignored.
Comment #8
jlnknz CreditAttribution: jlnknz commentedOK. There was actually no bug on file paths as CKEditor was not involved in such links. Makes sense.
Thank you for the clarification.
Best,
Julien.
Comment #9
jlnknz CreditAttribution: jlnknz commentedBy the way, do you plan to release a new (non-dev) version soon? This bug hinders using CKEditor Link on i18n-ed sites. Pretty blocking.
Best,
Julien
Comment #10
anrikun CreditAttribution: anrikun commented@clrdd: 6.x-2.1 and 7.x-2.1 are out :-)
Comment #11
jlnknz CreditAttribution: jlnknz commentedGreat! Many thanks for your reactivity :-)
Best,
Julien
Comment #13
broonI am using this thread as I experience the exact same error with 6.x-2.2, any thoughts on how this bug got back into the module?
Comment #14
anrikun CreditAttribution: anrikun commentedCould you provide some more info.
Any URL?
What is the path of the file you enter? What is the path after it gets filtered?
Comment #15
broonOne example: http://ecologic.eu/2714
In the main content section, if you click "Our responsibility" the very first sentence contains a link to a PDF file. It totally works in English version as English pages do not use language prefix. The link itself is entered as
<a href="/download/verschiedenes/About_us_neu/Statutes_EN.pdf">statuses</a>
and in English version this translates correctly to http://ecologic.eu/download/verschiedenes/About_us_neu/Statutes_EN.pdf, however in German version the corresponding link is set as
<a href="/download/verschiedenes/About_us_neu/Satzung_DE.pdf">Satzung</a>
and it should become http://ecologic.eu/download/verschiedenes/About_us_neu/Satzung_DE.pdf (note there is no prefix). Instead, with ckeditor_link enabled it shows as http://ecologic.eu/de/download/verschiedenes/About_us_neu/Satzung_DE.pdf (note the prefix for German "de").
For now, I have disabled ckeditor_link, flushed the cache and all links are now correct (without editing any node or disabling anything else.
Comment #16
anrikun CreditAttribution: anrikun commentedWhere is the download folder? Does it reside in your public file system (by defaut, it is sites/default/files)?
Comment #17
broonNo, it's not within the public files folder Drupal uses, but it's within public html root.
Comment #18
anrikun CreditAttribution: anrikun commentedThat's why CKEditor Link doesn't handle your file paths correctly. Currently, CKEditor Link expects files to reside in the Drupal file system.
I agree this might be considered as a bug.
Can you confirm that you use 6.x-2.x (not 7.x-2.x)?
Comment #19
broonSorry for getting back so late. Yes, I can confirm it is a Drupal 6 website and I am using 6.x version of CKEditor Link.
Comment #20
lucuhb CreditAttribution: lucuhb commentedI have the same problem for file link in pages for language with prefix. My default language is french, with no prefix, and prefix "en" for english pages.
For a link to the same file, the prefix 'en' is added in english page and the link is wrong (404 error).
For exemple, in french, the link to the file is : http://mysite.fr/sites/default/files/myfile.pdf, but in a english page, the link for the same file is http://mysite.fr/en/sites/default/files/myfile.pdf
The problem seems to be in the ckeditor_link_url() function of ckeditor_link.module, when the url() function is called (before this function, the file url is OK, bad after)
Comment #21
anrikun CreditAttribution: anrikun commented@lucuhb:
It's strange that this bug happens to you too as files like yours inside Drupal file system are handled properly.
Are you sure you use 6.x-2.2?
Anyway, I will submit a better fix ASAP.
Comment #22
anrikun CreditAttribution: anrikun commented@Paul.B, lucuhb:
I have just committed a new fix.
Please get it from git or try 6.x-2.x-dev once it's updated and confirm that it works.
Edit: committed to 7.x-2.x too (even if this bug seems to affect 6.x-2.x only)
Comment #23
lucuhb CreditAttribution: lucuhb commentedGreat, it works for me, thanks anrikun !