Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi all,
in a multilingual site, the page URL is written without the lang prefix in the url, so I have:
st_url="mysite/my-eng-page"
st_url="mysite/my-ita-page"
instead of
st_url="mysite/en/my-eng-page"
st_url="mysite/it/my-ita-page"
This cause wrong sharing.
Can you please resolve this issue? Is CRITICAL for everyone using multilingual websites!
Thank you very much!
Comment | File | Size | Author |
---|---|---|---|
#4 | 1801970.patch | 781 bytes | RobLoach |
Comments
Comment #1
MXTI think this happen because you build the path in this way in your module:
$mPath = $base_url . $path_module;
where $path_module = '/' . drupal_lookup_path('alias',"node/" . $node->nid);
but neither $base_url nor drupal_lookup_path returns language prefix.
using request_uri() instead, things works well:
$mPath = $base_url . request_uri();
but I'm not a programmer, so I cant give a definitive solution or a patch
Comment #2
djschoone CreditAttribution: djschoone commentedI would like to propose this fix. It uses the url() so no need to check if the pathauto module exists also, because url() does this for you. And ofcourse this function does link correct to the language prefix for the selected language.
I will commit if anyone can confirm it works!
Tested on 7.x-2.5 (==HEAD below)
Comment #3
MXTI've tried it: yes seems to works correctly: thank you!
Comment #4
RobLoachComment #4.0
RobLoachlittle mistake...
Comment #5
yaelsho CreditAttribution: yaelsho commentedHello,
I just tested it and its working.
Is there any concern in committing it?
Thanks, Yael
Comment #6
ckhalilo CreditAttribution: ckhalilo commentedNot the same problem but in same category mutli-lang $node->path becomes array, so we have to check if path is array.
I fixed issue by Modifiying this.
Line 307 :
Note that module pathauto is not active.
Comment #7
purushotam.rai CreditAttribution: purushotam.rai at QED42 commentedThis issue probably has been fixed now on 7.x-2.x-dev branch.
Comment #8
purushotam.rai CreditAttribution: purushotam.rai at QED42 commentedMarking this issue as fixed. Thanks a lot for all your inputs. We really appreciate your efforts towards this issue. Feel free to re-open if issue persists.
Thanks
Comment #9
purushotam.rai CreditAttribution: purushotam.rai at QED42 commented