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

anrikun’s picture

Category: support » bug

You are right, this is a bug of the filter part!
Will try to fix it ASAP.
Thanks a lot for reporting this!

anrikun’s picture

This is now fixed in 6.x-2.x-dev.
J0nathan, can you please confirm that it works?

j0nathan’s picture

Status: Active » Fixed

Hi anrikun,
I confirm this is resolved with 6.x-2.x-dev.
Thank you very much!

anrikun’s picture

Version: 6.x-2.0 » 7.x-2.0
Category: bug » task
Status: Fixed » Active

Thanks!
This now needs to be ported to 7.x-2.x.

anrikun’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Status: Active » Fixed

Ported to 7.x-2.x-dev

jlnknz’s picture

Hello,

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.

anrikun’s picture

This 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.

jlnknz’s picture

OK. 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.

jlnknz’s picture

By 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

anrikun’s picture

@clrdd: 6.x-2.1 and 7.x-2.1 are out :-)

jlnknz’s picture

Great! Many thanks for your reactivity :-)

Best,

Julien

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

broon’s picture

Version: 7.x-2.x-dev » 6.x-2.2
Category: task » bug

I 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?

anrikun’s picture

Could you provide some more info.
Any URL?
What is the path of the file you enter? What is the path after it gets filtered?

broon’s picture

One 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.

anrikun’s picture

Where is the download folder? Does it reside in your public file system (by defaut, it is sites/default/files)?

broon’s picture

No, it's not within the public files folder Drupal uses, but it's within public html root.

anrikun’s picture

That'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)?

broon’s picture

Sorry 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.

lucuhb’s picture

I 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)

anrikun’s picture

@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.

anrikun’s picture

Status: Closed (fixed) » Fixed

@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)

lucuhb’s picture

Great, it works for me, thanks anrikun !

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.