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
Comment #1
Andreas Goebel commentedHello,
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
Comment #2
Andreas Goebel commentedHello,
I have just updated to the latest version of i18n, the error still occurs.
Andreas Goebel
Comment #3
maartenvg commentedI believe this is an issue with i18n, not with drupal. See also #332617: Same node displayed multiple times..
Comment #4
Andreas Goebel commentedThank 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
Comment #5
jose reyero commentedI 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)...
Comment #6
Andreas Goebel commentedHi,
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
Comment #7
Andreas Goebel commentedSorry, 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
Comment #8
jose reyero commentedWell, 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.
Comment #9
jose reyero commentedYup, 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...
Comment #10
Andreas Goebel commentedHi,
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
Comment #11
Andreas Goebel commentedHi again,
I have installed i18n.module manually, it works fine.
Thanks for the good and quick fix!
Regards,
Andreas
Comment #12
Andreas Goebel commentedfixed.