I'm running a multilingual site with 2 languages. Latest DEV is installed and language detection is made via path /de and /en.

I have Workbench Moderation enabled nodes only and the content is <a href="node/656/">Foo in 2013</a>, but this is still shown in final source code. The internal path is not replaced with the aliases.

CommentFileSizeAuthor
#17 node_alias_path-1885490-16.patch477 bytespsicomante

Comments

Garrett Albright’s picture

Which path are you using when editing the node? /de, /en, or no path?

hass’s picture

/de - the default language on the site.

Garrett Albright’s picture

Okay, I was able to replicate this behavior when, as in your example, I put a slash at the end of the path - that is, <a href="node/656/"> instead of <a href="node/656">. So for now, I would suggest removing that slash at the end of your paths. I know that Drupal's menu system will bring you to the same node with either path, but at least in terms of its internals, the latter is the "correct" path for the node. (In code terms, url('node/656') will find and return the alias for that node, but url('node/656/') will not. And it could be said that Pathologic is just a complex wrapper around the url() function.)

Is this a deal-breaker for you? Are you not able to correct those paths somehow?

hass’s picture

Priority: Critical » Normal

Damn... You are correct, I missed the trailing slash. It seems to have been added by http://drupal.org/project/ckeditor_link. I investigate there first. I do not think you need to support this in pathologic. Once I found the bug I will add a reference here and close. Thanks for your help.

hass’s picture

Project: Pathologic » CKEditor Link
Version: 7.x-2.x-dev » 7.x-2.2
Priority: Normal » Critical
hass’s picture

anrikun’s picture

Category: bug » support
Priority: Critical » Normal

CKEditor Link does not add slashes like this. What makes you think your issue is caused by CKEditor Link? At least, provide some information.
Turning this into a support request for now.

hass’s picture

Category: support » bug

Tried it again myself and I have no clue how the people who have written the content have been able to created these paths. But once you have added such a path to content manually and edit the link again it's loaded silently and is than corrected to node/546 if I press save. So the problem corrects itself, but I do not expect that the users have added this themself. Need to try to figure out by asking the editors.

On my DEV box the paths are <a href="/foo/node/546">Foo</a>. On my life site it's <a href="/node/546">Foo</a>. The basepath shouldn't be added to the path. Only the Drupal internal path should be saved in content. This is also what pathologic does.

Otherwise you will run into troubles; if you move content from live to dev and vice versa as the base path will change. I have done this and all the links are broken now.

hass’s picture

Priority: Normal » Critical

Additional if I have path based language negotiation enabled

<a href="/node/123">Foo</a> becomes <a href="/de/de/foo/bar">Foo</a>. You can see, the language is added twice.

hass’s picture

Maybe the last is caused by pathologic...

hass’s picture

Damn, it's pathologic 2.6 that causes double prefix. I've installed latest DEV and it's fixed now.

However it still stands, this module need to change it's path to node/11 without prefixing in the saved content and the filter handles the rest.

anrikun’s picture

Category: bug » support
Priority: Critical » Normal

Again there is no critical bug here!
CKEditor Link works as designed.
I'm OK to help but please stop posting critical bug reports when there are not.
Have you tried latest dev?

hass’s picture

Category: support » task

Have you read my last comments?

anrikun’s picture

On my DEV box the paths are <a href="/foo/node/546">Foo</a>. On my life site it's <a href="/node/546">Foo</a>.

Yes I have read your last comments, and you should use Pathologic to handle your case.
This was answered earlier here: #962114: Adjusting Base of Link Path
and here: #1024292: Store only node path in database
Base path is present by design so that links are real links.
You know, you'll run into the same problem with links to files or to images added for instance from IMCE, and even changing CKEditor Link wouldn't fix these links.
So Pathologic is the best way to solve your problem: it was made for thid purpose after all.

If you're experiencing problems to make CKEditor Link and Pathologic work well together, I'm OK to help.
I'm sure it used to work (see previous issues above). If it doesn't anymore, something must have changed in one of the modules that broke this and I need to have a look at it.

feddovdm’s picture

Well, just as a note: did you try telling your content formats that the path's added needed to be displayed as a alias url?

config > content > formats
ex. full-html, select: CKEditor Link Filter

psicomante’s picture

I made a patch to have the aliased url for node saved in the database.

psicomante’s picture

Issue summary: View changes
StatusFileSize
new477 bytes
jprstoney’s picture

Well, just as a note: did you try telling your content formats that the path's added needed to be displayed as a alias url?

config > content > formats
ex. full-html, select: CKEditor Link Filter

Genius. Solved my issue. Thanks feddovdm

carcheky’s picture

I use global redirect for this