Closed (fixed)
Project:
Localization server
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Mar 2008 at 22:33 UTC
Updated:
7 Oct 2009 at 15:30 UTC
After i search for strings they are often shown to have suggestions. If i click on the "Show detailed information" button no suggestion is displayed. What's wrong here?
Comments
Comment #1
hass commentedI cannot look inside the DB to say for sure, but it could be possible that this comes from duplicate suggestions with completely same wording.
Comment #2
gábor hojtsyIf there is duplicate suggestions, then there would be at least two suggestions, or otherwise they would not be duplicates, right? The "has_suggestions" flag in the database and on the user interface is "cached" data, and ideally should always reflect the current state. This is to avoid to do a count query on all suggestions for each string. So it is possible the data is somehow out of sync, in which case this should be investigated.
Comment #3
hass commentedYou can log on yourself with drupal.org account and see at http://de.kkaefer.com/. After login, go to "Edit" > Search for 'drupal' and release '6.0' and 'has suggestions'. Then the orange marker is shown on the first two strings "php" and "MySQL database" (only two examples). If i click the orange marker I see the string - *no* suggestion and "Translated by: admin at 8. February 2008 - 22:33"... must be a ~2 month cache :-)
Comment #4
gábor hojtsyWell, cache might not be the right word. This flag is not regenerated from time to time but only when there is some actions regarding suggestions (one is added, approved or deleted). If you removed suggestions from the database by hand, the flag was not updated obviously, because it is updated as part of the process of doing the action with the suggestion in l10n_server. One option might be to have a "consistency update" of this flag on crons, with something like (pseudo code):
This has an obvious data inconsistency point between the two queries, where the UI would display bad data, so if you can build this to one reasonable query, then feel free :) Updating all strings one by one with COUNT() subqueries sounds like very bad performance wise (this is why we have this cached flag).
Comment #5
hass commentedI pleased kkaefer some minutes ago to join this case and take a look to the DB first.
The strings i wrote about above are only strings from the very first import... and in the case of such strings with fake suggestions i tried some days ago, to add a blank to the end and then remove the blank again. It hasn't helped...
Not sure how this behavior fit in the caching logic you described...
Comment #6
kkaefer commentedMy solution to this:
Comment #7
kkaefer commentedBtw, this inconsistency is due to me deleting manually translations directly in the database because someone imported a foreign translation into the German language translation.
Comment #8
hass commentedI don't think so. This problem was already there before we deleted this foreign language suggestions!
Comment #9
gábor hojtsyhass: Konstantin's explanation on the manual deletion is exactly what makes this "cached" flag outdated, so if it did not happen earlier, it surely happened with that manual deletion. If it happened earlier (before any manual tweaking in the database), then you need to find out what has happened, or try to reproduce it. I have not heard this report from others, who don't work directly on their databases.
Comment #10
hass commentedI would close this case for now, but would please Konstantin to post the SQL he executed to fix this issue. I'm sure others are also interested...
Maybe you are able to add a checkbox like "Re-build translation statistics" :-).
Comment #11
gábor hojtsyAs I said in #4, we can add an update on cron, if it looks workable to make this fix automated.
Comment #12
kkaefer commentedThe SQL queries are posted above.
Comment #13
hass commentedUps... overlooked #6. Let this stay open, maybe others need this too and maybe Gabor likes to integrate the SQL into a cron job!?
Comment #14
meba commentedLet's close this since it's more than a year old?
Comment #15
hass commentedNot yet fixed as I know.
Comment #16
gábor hojtsyNo inconsistencies arise from the normal use of the server and the moderate page now allows for mass-moderation. Therefore I'm not going to add one-time hacks like creating temporary tables for cleanups which are not needed on normal operation to the module.
We can either mark this fixed (as in fixed for the German server) or won't fix (as in this hack is not getting into l10n_server as the underlying error was not in the server).
Comment #17
gábor hojtsyAlso retitling for the correct problem at hand.
Comment #18
hass commentedYeah, until someone imports Turkish into Hungarian and you need to fix on DB level :-).