Yesterday my french translator posted a story to my website. This shows eight times!

Similar things happen at the forum (which I have now discarded, I use a different forum software) and the image gallery.

Steps to reproduce the bug:
Please have a look at this at www.raumgeometrie.de/drupal/fr
What behavior was I expecting?
The story should appear only once.
What happened instead?
The story showed eight times

OS: Linux, Webserver: Apache, MySQL Version: 5.0.67, PHP: 5.2.6

I think this is a critical bug, as it makes drupal almost unusable for multilingual pages.

Regards,

Andreas Goebel

Comments

Andreas Goebel’s picture

Hello,

now that the weekend is over I allow myself to push this issue.

If noone feels willing and competent to fix this bug, I ask that someone at least points me to a direction where this bug might come from.

I am myself a very skilled programmer (c++) but have no experience whatsoever with php and very little experience with database queries. I don´t even know if there is a debugger for php.

Regards,

Andreas Goebel

Andreas Goebel’s picture

Hello,

I have just updated to the latest version of i18n, the error still occurs.

Andreas Goebel

maartenvg’s picture

Project: Drupal core » Internationalization
Version: 6.6 » 6.x-1.0-beta6
Component: language system » Code

I believe this is an issue with i18n, not with drupal. See also #332617: Same node displayed multiple times..

Andreas Goebel’s picture

Thank you,

I think that it is the same issue. But the old message is with drupal 5.x, so this bug is around for some time.

I would really like to use the mix-setting "current language or language neutral or default language", as it ensures that all content is seen, even if it is not (yet) fully translated.

Regards,

Andreas

jose reyero’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

I cannot reproduce and I don't think this is an issue with i18n 6.x (it is not the same that the 5.x issue).

So please confirm that this stops happening when disabling i18n, try other selection modes (simple) too, and if I could see the query produced it would be a great help (devel module, enable query log, print the pager_query for node selection)...

Andreas Goebel’s picture

Hi,

thank you for looking into this.

a) I have changed the setting to "preferred and language neutral only" and the problem goes away. I have not disabled i18n module, as I don´t know if my translated content will be deleted then.

b) I have installed the devel module, enabled the query log, but I don´t know how to print the pager_query for node selection.

I get queries like this:

0.9 1 locale SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid = t.lid AND t.language = 'fr' WHERE s.source = 'Helper functions, pages, and blocks to assist Drupal developers. The devel blocks can be managed via the !block page.' AND s.textgroup = 'default'
0.86 1 locale SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid = t.lid AND t.language = 'fr' WHERE s.source = 'Query log' AND s.textgroup = 'default'
1.33 1 locale UPDATE locales_source SET version = '6.6' WHERE lid = 3692
0.91 34 cache_clear_all DELETE FROM cache WHERE cid LIKE 'locale:%'

This repeats multiple times.

I will happily provide the needed information, sorry that I don´t know how.

Regards,

Andreas

Andreas Goebel’s picture

Sorry, I was being stupid.

I did not realize that the query log is printed down on each page when it is generated.

You find the page showing the error (with the query) here:

http://raumgeometrie.de/query_fr.htm

(I saved it to a htm-file)

Regards,

Andreas

jose reyero’s picture

Assigned: Unassigned » jose reyero
Category: support » bug
Status: Postponed (maintainer needs more info) » Active

Well, I guess this confirms it is actually a bug in i18n.

The query I needed is in the list, thanks. Sorry I didn't explain myself about the 'pager_query'..

I'll look into this and fix the issue.

0.24	1	pager_query	SELECT COUNT(*) FROM node n LEFT JOIN node i18n ON n.tnid = i18n.tnid AND i18n.language = 'fr' WHERE (n.language ='fr' OR n.language ='' OR n.language IS NULL OR (n.language = 'en' AND i18n.nid IS NULL)) AND ( n.promote = 1 AND n.status = 1 )
0.19	1	pager_query	SELECT n.nid, n.sticky, n.created FROM node n LEFT JOIN node i18n ON n.tnid = i18n.tnid AND i18n.language = 'fr' WHERE (n.language ='fr' OR n.language ='' OR n.language IS NULL OR (n.language = 'en' AND i18n.nid IS NULL)) AND ( n.promote = 1 AND n.status = 1 )ORDER BY n.sticky DESC, n.created DESC LIMIT 0, 10
jose reyero’s picture

Yup, there seems to be something wrong with that query, it was not repeatable with my testing dataset though. I've just committed a tentative fix for this

Instead of

SELECT n.nid, n.sticky, n.created FROM node n LEFT JOIN node i18n ON n.tnid = i18n.tnid AND i18n.language = 'fr' WHERE (n.language ='fr' OR n.language ='' OR n.language IS NULL OR (n.language = 'en' AND i18n.nid IS NULL)) AND ( n.promote = 1 AND n.status = 1 ) ORDER BY n.sticky DESC, n.created DESC LIMIT 0, 10

It should be

SELECT n.nid, n.sticky, n.created FROM node n LEFT JOIN node i18n ON i18n.tnid > 0 AND n.tnid = i18n.tnid AND i18n.language = 'fr' WHERE (n.language ='fr' OR n.language ='' OR n.language IS NULL OR (n.language = 'en' AND i18n.nid IS NULL)) AND ( n.promote = 1 AND n.status = 1 )ORDER BY n.sticky DESC, n.created DESC LIMIT 0, 10

(so we don't join all rows with tnid = 0)

It may take a few hours to get repackaged, so if you could confirm this works either manually running the query, or trying http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/i18n/i18n.m...

Andreas Goebel’s picture

Hi,

I´ve executed the query, it seems to work fine (I get seven items with different ids, as it should be).

I´ll install the new module later.

Thank you!

Andreas

Andreas Goebel’s picture

Hi again,

I have installed i18n.module manually, it works fine.

Thanks for the good and quick fix!

Regards,

Andreas

Andreas Goebel’s picture

Status: Active » Fixed

fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.