I'm using pathfilter 6.x-2.0-beta3 in a site with i18n enabled and two languages set: en (for english), it (for italian).
Language negotiation is done by: "Path prefix with language fallback."
Path filter is configured so: "Convert internal paths to:Absolute URL", "Enable automatic url processing for attributes: yes"
Let's say we want to link node/4 with autopath alias "node-4-alias". Node 4 is language neutral.
Let's say current selected language is 'en'.
First we create a link as "internal:node-4-alias" witch becomes "www.mysite.com/en/node-4-alias"
next time we edit and save the page we get "www.mysite.com/en/en/node-4-alias" which is broken
Each more time we edit and save we get "www.mysite.com/en/en/../en/en/node-4-alias" which of course is broken.
The problem does not happen when linking by node "internal:node/4" which gets always shown "www.mysite.com/en/node-4-alias"
I hope I clearly explained the problem
Comments
Comment #1
mrfelton commentedI think you are using the module incorrectly. You shouldn't be creating links such as internal:node-alias... when you create internal: links, you should always be using the node id, otherwise it is not an internal link (internal implies node id)
Comment #2
Jamiro-1 commentedinternal links by node-alias should be supported seeing here
such as "internal:admin/user" -> "http://example.com/admin/user"
Comment #3
mrfelton commented@Jamiro: admin/user is not an alias, it is the Drupal internal path to a system page defined in hook_menu by user.module. The internal path for nodes is of the format node/123
Comment #4
Jamiro-1 commentedok great! so it's only my fault ;) sorry for the inconvenience and thank you mrfelton for your reply :)
Comment #5
mrfelton commentedNo problem.
ps. If you have the "Enable automatic url processing for attributes" setting enabled, you should be able to simply enter your link as "www.mysite.com/node-4-alias" or "/node-4-alias" and upon saving, it should be converted to "internal:node/4" for you automatically and stored in the database that way.
Comment #6
Jamiro-1 commentedno sorry, I tried with language neautral and also with language specific nodes and the link problem using alias still remains, no automatic conversion to node ID from alias.
Another problem I noticed is this: assuming my upload folder for users is www.mysite.com/sites/default/files
if I link any file not in that directory but still in my domain like www.mysite.com/private/me.jpg
this becomes a broken link www.mysite.com/it/private/me.jpg
for files in www.mysite.com/sites/default/files everything is ok.
Another example: if I link "www.mysite.com/welcome" this get saved as "internal:en/welcome" which works because is presented as "www.mysite.com/en/welcome" but if I edit&save the page once more i get the same problem of the first post.
Comment #7
mrfelton commentedComment #8
mrfelton commentedI have made some changes to the code in CVS - seems to be working for me. Would you mind testing please?
Comment #9
Jamiro-1 commentedsure. I'll check up asap
Comment #13
mstrelan commentedI have done some testing and this is what I have found:
If "Enable automatic url processing for attributes" is enabled and you try to save http://www.example.com/en/node/6 it gets converted to internal:node/6. When the page is reloaded it is converted back to http://www.example.com/XX/node/6 where XX appears to be the language that you are currently viewing. You cannot save a path like internal:it/node/6 and therefore there is no way to force the path that is saved to use a particular lanugage.
To me it seems like it is working ok. I'm not sure about the files directory stuff though, I haven't test that.
Comment #14
mrfelton commentedYep - That is the correct behavior. Marking as fixed.