user warning: Field 'uid_approved' doesn't have a default value query: INSERT INTO l10n_community_translation (sid, translation, language, uid_entered, time_entered, is_active) VALUES (1, 'Zur Navigation springen', 'pl', 1, 1197893706, 1) in C:\Inetpub\wwwroot\drupal5localize\includes\database.mysql.inc on line 172.
CommentFileSizeAuthor
#8 default0_1.patch2.35 KBhass
#5 default0.patch2.31 KBgábor hojtsy

Comments

hass’s picture

Ops, this problem occurred when i'm trying to import an already translated pot file into one project...

hass’s picture

Priority: Normal » Critical

This modules are active:

0. Locale
1. Localization community
2. Localization community for local packages
3. Translation template extractor

4. Upload
+ standard core

hass’s picture

Looks like caused by line 789 in l10n_community.module. The query does not contain all required columns.

hass’s picture

This fixed the first time import without suggestion check box for me, but i'm totally unsure if this defaults are all correct. Additional to this the above INSERTS in if ($suggestion) { are broken, too.

// No active translation yet -> INSERT.
db_query("INSERT INTO {l10n_community_translation} (sid, translation, language, uid_entered, uid_approved, time_entered, time_approved, has_suggestion, is_suggestion, is_active) VALUES (%d, '%s', '%s', %d, %d, %d, %d, %d, %d, 1)", $sid, $translation, $langcode, $uid, 0, time(), 0, 0, ($suggestion ? 1 : 0));
gábor hojtsy’s picture

Version: 5.x-1.x-dev » 5.x-1.0-alpha2
Status: Active » Needs review
StatusFileSize
new2.31 KB

You run on a MySQL in strict mode apparently, as otherwise these are silently ignored. Hm, anyway, added defaults in this patch. Please test with this applied and the update run. Patch is against alpha2.

hass’s picture

Status: Needs review » Needs work

Parse error: syntax error, unexpected '}' in C:\Inetpub\wwwroot\drupal5localize\sites\all\modules\l10n_server\l10n_community\l10n_community.install on line 158

gábor hojtsy’s picture

Oh, please add that missing { on the foreach and test again.

hass’s picture

Status: Needs work » Needs review
StatusFileSize
new2.35 KB

fixed patch

gábor hojtsy’s picture

Doh, it is a bit late. I should have used db_change_column() actually.

hass’s picture

Status: Needs review » Reviewed & tested by the community

I tried an import, reimport and editing of some translation strings it looks now working as expected. thx

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

Great. We still need to make this use db_change_field() for the APIs sake :) One less item to care if someone likes to make the module work nicely with postgresql.

hass’s picture

Status: Needs work » Reviewed & tested by the community

Sorry, but db_change_field is D6 only... now we have D5... so the patch is ok.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Hm, I understand that this ALTER approach does not work with postgres, but we don't have postgres users so far, and they will get the new schema anyway, so this will not affect them. That said, to concentrate on more important tasks, I committed this. Thanks!

gábor hojtsy’s picture

Status: Fixed » Closed (fixed)