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.
When I'm on frontpage, I expect the icons url to point to http://mysite.com and the http://mysite.com/id.
Instead i got http://mysite.com/nwhome/home and http://mysite.com/id/nwhome/home respectively.
I'm setting the frontpage to nwhome/home. It's a content type specially crafted for frontpage.
Anybody experiencing this issue ?
PS: Take a look at http://alpha.yasati.org for more info.
Comment | File | Size | Author |
---|---|---|---|
#22 | 295626-locale-block-frontpage.patch | 1.84 KB | Damien Tournoud |
#19 | locale_295626.patch | 1.82 KB | drewish |
#16 | locale.block_.patch | 1.15 KB | wuf31 |
#13 | locale.block_.patch | 1.15 KB | wuf31 |
#11 | locale.block_.front_.patch | 1.18 KB | wuf31 |
Comments
Comment #1
Freso CreditAttribution: Freso commentedLanguage Icons only add icons to the links, it doesn't generate the links themselves.
Comment #2
wuf31 CreditAttribution: wuf31 commentedThanks, Fresco for pointing out that it's the locale module problem..
Though I still think this is a bug..
Attached is a one line patch for locale module to fix this problem..
Please review :)
Comment #3
Freso CreditAttribution: Freso commentedRight, of course. Anyway, if you want to have it fixed, it should go to 7.x (and then backported to 6.x) - of course, only if the bug still exists in the 7.x code base.
First off: A quick work around for your sites could be to use the Global Redirect module until the issue is fixed.
Second: Perhaps something smarter than
$_GET['q'] == variable_get('site_frontpage', 'node') ? '' : $_GET['q']
could be used to determine if we're already in the frontpage? Obviously, when you're on "site/" or "site/en",$_GET['q']
will be''
- that is, not'node'
or any other string set as thesite_frontpage
variable. Or perhaps we could just remove the logic all together, as is done in the patch? This is what is done anyway, if not on the front page, so...Comment #4
wuf31 CreditAttribution: wuf31 commentedwell, let's just keep it simple..
As actually I don't quite follow you :P
Btw, is there any obvious bugs by doing it this way?
Comment #5
kscheirerhow about
drupal_is_front_page()
instead? Btw, it looks like this has already been changed in HEAD, so there must be another issue dealing with this, but I couldn't locate one.Currently the code reads
Comment #6
Freso CreditAttribution: Freso commentedThe code seems to be from #141996: Language switcher block, which used
'href' => $_GET['q']
... and it doesn't seem to have changed in neither 6.x or 7.x.(And now in the proper issue to boot.)
Comment #7
selebritis CreditAttribution: selebritis commentedhave the same problem, thank you I'll try it first ...
Comment #8
Damien Tournoud CreditAttribution: Damien Tournoud commentedThe proper way is indeed to call drupal_is_front_page(), and to use '' when it is. url() will take care of the rest.
Comment #9
wuf31 CreditAttribution: wuf31 commentedThanks Damien,
Patch tested on 6.4.
Seems good.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedThe patch looks good to me and the OP is satisfied. Marking RTBC.
Comment #11
wuf31 CreditAttribution: wuf31 commentedModified patch to let i18n play nicely with the locale block.
Any review??
Comment #13
wuf31 CreditAttribution: wuf31 commentedCool.. QA Patch tester :P
Let's try this..
Comment #14
wuf31 CreditAttribution: wuf31 commentedComment #16
wuf31 CreditAttribution: wuf31 commentedAnother try..
It it still doesn't work.. I'll let others give it a shot.
Comment #18
meba CreditAttribution: meba commentedsubscribe. i didn't test this yet, but upon looking into code, i don't like that we are adding yet another SQL query for determining the path. Is there another solution?
Comment #19
drewish CreditAttribution: drewish commentedplease try this patch out.
Comment #20
Damien Tournoud CreditAttribution: Damien Tournoud commented@drewish:
Please remove the spaces after the $path.
@meba:
We are not adding an SQL query.
drupal_is_front_page()
is cached, and it is called anyway (for example inmenu_get_active_breadcrumb()
.Comment #21
drewish CreditAttribution: drewish commentedDamien Tournoud, at this point for a one character change you could re-roll the patch as easily as i could... or heck you could just edit the patch.
Comment #22
Damien Tournoud CreditAttribution: Damien Tournoud commented@drewish: why are you not allowing me to be lazy?
Here is a proper patch, I confirmed again it works as intended. Because the patch is trivial and several people already looked at it, I'm marking this as ready to go in.
Comment #23
webchickThanks guys, comitted. Marking down to 6.x for consideration.
Comment #24
Gábor HojtsyThanks, committed to Drupal 6.x.
Comment #25
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.