Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
language system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Nov 2009 at 14:22 UTC
Updated:
11 Dec 2010 at 13:46 UTC
Jump to comment: Most recent file
Comments
Comment #1
plachThe attached patch fixes the wrong condition and integrates Locale tests to detect this failure.
Comment #2
plachCleaning-up the "locale module" issue queue as per http://cyrve.com/criticals.
Comment #3
plachrerolled
Comment #4
plachRelated issue: #778528: Define the language switcher's correct behavior.
Comment #5
berdir#3: locale-631928-3.patch queued for re-testing.
Comment #6
plachComment #7
plach#3: locale-631928-3.patch queued for re-testing.
Comment #8
giorgosk#3 patch does not work as advertised
2 language links are presented for a tranlatable node with no translation
Comment #9
giorgoskdon't know how I managed to change the tags
Comment #10
plach@GiorgiosK:
This is the D6 behavior and is not covered by this issue, #518364: Nodes with one language don't affect the language switcher block addresses it.
Steps to reproduce/test this:
Comment #11
giorgosk@plach
I did follow all your steps above on a fresh install of drupal 7.x-beta1
applied patch from #3 I even made sure the patch changes were applied
correctly (inspecting the files with editor)
but still the behaviour is same as before patch
when viewing EN node two language links are present 1 for itself and 1 for the
unpublished translation node
when and anonymous tries to follow translation link gets "access denied"
I have the feeling that #518364: Nodes with one language don't affect the language switcher block should be worked together with this issue because its the generalization of this limited scenario
Comment #12
plach@GiorgosK:
They are not the same issue, so we need two separate ones.
The fact that the patch passes its own test suggests that it's working. You are seeing "access denied" because you are using D7 beta1, while the fix is against the HEAD. I tested the path in #10 with a fresh HEAD checkout this morning before posting it. Correct unpublished translations handling did not get into D7 beta1.
Please be sure to have the latest code before changing the status again.
Comment #13
giorgosksorry @plach I did not know it would make such a difference
with latest dev tarball things are better
but still get the the link to ITSELF - language switcher does not dissapear as per 7. above
8. is as you described
Comment #14
peximo commentedI have tested the patch with the latest HEAD as described in #10 and it works as expected.
Comment #15
giorgoskjust tested with latest HEAD
works as described in #10
Comment #16
plach@GiorgiosK:
Thanks for your patience :)
Comment #17
giorgoskalways glad to help ;-)
Comment #18
plachrerolled
Comment #19
webchickHm. I share GiorgosK's confusion. It seems like depending on what we do over at #518364: Nodes with one language don't affect the language switcher block these tests may or may not codify the right behaviour? Should this be committed anyway, or should we smoosh the two issues together since they're so related?
Comment #20
plach@webchick:
Well this issue fixes the general behavior of the language switcher, while the other one concerns the relation between the language switcher and the Translation module. As we discussed in IRC, IMO if there is only a single link available and it matches the current language the correct behavior is hiding the block. It's up to modules implementing http://api.drupal.org/api/function/hook_language_switch_links_alter/7 to avoid this situation if it's not the desired behavior.
Anyway, we can mark this duplicate of the other one, but IMO we have two independent, although strictly related, discussions to bring on.
Edit: the tests here won't be modified by what we decide in the other issue.
Comment #21
plachAnother possibility is that, since the only core module actually dealing with the language switcher block is Translation, we remove the condition on the links number altogether:
becomes
This way we would allow other modules to implement self-hiding blocks through http://api.drupal.org/api/function/language_negotiation_get_switch_links/7, which encapsulates most of the logic needed to generate a language switcher block.
Comment #22
webchickHm. That's an interesting idea. Anyone else have opinions on that?
Also, removing "Quick fix" because it's a LIE. ;)
Comment #23
plach@webchick:
I was in good faith :)
I didn't think we would end up in an architectural discussion, I just wanted to fix that damn parenthesis.
Comment #24
plachAs suggested by GiorgiosK and webchick, this has been fixed in #518364: Nodes with one language don't affect the language switcher block.
Comment #25
egon.ojamaa commentedHey drupal fans..
Here is the quick fix you need.. http://drupal.org/node/995500
No core hacking, and no waiting for a new release of core with a fix.