The issues was first documented here: http://drupal.org/node/634144.
I'm supplying the solutions provided here http://drupal.org/node/634144#comment-3096616 in a form of patch.

Goal

Use views to display the multi-lingual content as per website Language settings (admin/settings/language/i18n) that are set to

Content selection mode: Mixed current language (if available) or default language (if not) and language neutral

In my example, I have English and French content.
English is a default language.
Not all the content is translated to French so Views should display the content in the user selected language but if any node is not available in that language, show the content in the default language (in this case English).

Problem

Internalization (i18n) module has Views filter "i18n: Content negotiation" that is suppose to "Removes the nodes that are not valid according to the content selection mode".
Unfortunately, this is not working correctly because when viewing the page in French, both French and English nodes were displayed although there were a translation of each other and only French nodes should be visible because they existed.

Solution

Thanks to the posters in this thread, the solution presented in the patch below

Comments

YK85’s picture

I think if the code in Select Translation module can be incorporated here, it will fix this issue and expand usage of the views filter in terms of multilingual sites
http://drupal.org/project/select_translation

Select translation implements a Views filter which allows you to select, for a group of nodes representing a same translation, which of the translation should be displayed.

The options are :

Use current language ; if not available use original language
Use current language ; if not available use default language ; if not available use original language
Provide a list of languages, so that the most appropriate language is selected. The list can contain the special values 'current', 'default' and 'original' for, respectively, the current language, the default language and the node's original language.

kirie’s picture

Status: Needs review » Reviewed & tested by the community

Fixes the issue as advertised

kirie’s picture

Version: 6.x-1.5 » 6.x-1.7

Bumping version number as well

lolmaus’s picture

I confirm the patch is working well!

I've only modified it to work with patch -p0 < blah command (removed the C:/... stuff).

alberto56’s picture

+1 the patch works. Thanks.

jose reyero’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

The patch looks good. However, how it will work with some other non views queries or whether it will work for all DBs (pgsl?) is uncertain.

As I understand, there are some other modules addressing the issue, so we won't risk regression issues at this point (Drupal 7 coming)

JGO’s picture

Hi,

We are now 2011, first reported this problem and fixed this over a year ago.
I don't see any other solution for this huge problem then applying this patch over and over with every update.

I think it's unacceptable that such a big bug is not fixed and patched in the main release :s

kasiawaka’s picture

Assigned: kasiawaka » Unassigned
Status: Closed (won't fix) » Reviewed & tested by the community

Updated the status to properly reflect that the patch is created but waiting to be ported to the module.

kasiawaka’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

Sorry, my bad, didn't notice that maintainers actually marked this thread as closed and decided not to fix it.

miro_dietiker’s picture

Version: 6.x-1.7 » 7.x-1.x-dev
Status: Closed (won't fix) » Postponed (maintainer needs more info)

I think we should check the D7 version first and make sure this bug is fixed for future now.

Can someone please check and report the state of the D7 version?

klonos’s picture

...subscribing.

@Jose, #6:

...As I understand, there are some other modules addressing the issue...

Care to share which ones? Are you referring to my workaround here perhaps?

klonos’s picture

...btw I agree with the status change. This issue shouldn't simply be ignored.

jose reyero’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

This 'mixed' option has been around for a long time and never working properly.

So: we are dropping it from i18n module.

Please, consider putting together a new module for complex content selection.

JGO’s picture

WTF are you crazy ? dropping support ??? pffff

klonos’s picture

Status: Closed (won't fix) » Postponed

I agree. This is a serious issue for us people with multilanguage sites. It is not polite to simply ignore us. It should be decided if either Views or i18n is the proper place for it to be handled, but it does need to be handled. I do understand that figuring out a battle plan and finally coding a solid solution might be really hard, but all this "hiding the dust under the carpet" thing is not the way to go.

Perhaps we can agree on setting this to "postponed" then? Once we decide if this belongs to either i18n, Views, or some other contrib module, we can move this issue to the proper queue, but please do not close it.

jose reyero’s picture

Ok, "postponed", then.

Anyway, just to make it clear, if we want a stable i18n release, incomplete features that break other modules' queries cannot be there. I think adding this never fully working query rewriting was a mistake in the first place, and so far has consumed a huge amount of time from everybody.

Moreover, there's no reason why this needs to be integrated into i18n. Any other simple module could do it even easier as it doesn't need to handle different 'selection' options. Just disable i18n_select, enable the other module. Also "Select Translation" or "i18n views" would be much better candidates for this feature.

Note D7 i18n_select has an option for not rewriting views queries at all, that is enabled by default (skip tags 'views'). Maybe that should be hardcoded.

lolmaus’s picture

Come on, there's a tested-and-confirmed patch already! Have you even tried it?

nor4a’s picture

Subscribing

jose reyero’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

This was a 6.x issue so changing version.

About this feature, it has many other problems including serious performance issues.

The patch includes subqueries and it is complex and runs for all views and non views queries. Also it would fit better as a views filter or on other modules (i18nviews, select_translation).

For the 6.x version our #1 priority is not breaking exsiting sites. About patching don't worry that much because there won't be many more 6.x releases.

So just "it fixes my views issue" is not enough here. There are many other hundreds of different node listings provided by other modules.

jose reyero’s picture

joseph.olstad’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)