Ticket #1827 (closed defect: fixed)

Opened 13 months ago

Last modified 6 months ago

Errors while saving

Reported by: zerrvox Owned by: ischommer
Priority: critical Milestone:
Component: translate.silverstripe.com Version:
Severity: medium effort / impact Keywords:
Cc: Hours:

Description

Several times while I was making the Danish translation the site gave an error while trying to save my changes. I was not able to track down exactly what caused this, but I think it could be related to the placeholders somehow, even though I have no idea how, as I only had the error while I was saving entries with placeholder.

I always experienced this while I submitted more than one entries, and it did in fact save some of the entries, which made it really hard to track down which entry was the faulty one. I did try to track down the entries which caused the problems but somehow it never seemed possible.

I did notice another bug though. The homepage of the translation site kept counting one up whenever I tried to save, so now the page shows that Danish still have 4 untranslated entries when it in fact have something like 16 untranslated entries.

Change History

Changed 12 months ago by ischommer

might have some clarifying information from the error-logs:

SET `String` = 'URL mudado para \'%s\null, this looks a bit dodgy, not sure....

Error: DATABASE ERROR: Couldn't run query: insert into `i18nEntity_lang_versions` SET `String` = 'URL mudado para \'%s\null, `LastEditorID` = '1721', `LastEdited` = now(), `OriginalLangID` = 52, `Lang` = 'pt_PT', `ClassName` = 'i18nEntity', `Created` = null, `Namespace` = null, `EntityName` = null, `FullName` = null, `Context` = null, `Status` = 'Unchanged', `Version` = 7, `TranslatingFrom` = null, `RecordID` = 52, `AuthorID` = 1721 | You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1721', `LastEdited` = now(), `OriginalLangID` = 52, `Lang` = 'pt_PT', `ClassName' at line 1
At line 397 in /sites/translate/www/sapphire/core/model/Database.php 

backtrace

user_error(DATABASE ERROR: Couldn't run query: insert into `i18nEntity_lang_versions` SET `String` = 'URL mudado para \'%s\null, `LastEditorID` = '1721', `LastEdited` = now(), `OriginalLangID` = 52, `Lang` = 'pt_PT', `ClassName` = 'i18nEntity', `Created` = null, `Namespace` = null, `EntityName` = null, `FullName` = null, `Context` = null, `Status` = 'Unchanged', `Version` = 7, `TranslatingFrom` = null, `RecordID` = 52, `AuthorID` = 1721 | You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1721', `LastEdited` = now(), `OriginalLangID` = 52, `Lang` = 'pt_PT', `ClassName' at line 1,256) line 397 of Database.php Database->databaseError(Couldn't run query: insert into `i18nEntity_lang_versions` SET `String` = 'URL mudado para \'%s\null, `LastEditorID` = '1721', `LastEdited` = now(), `OriginalLangID` = 52, `Lang` = 'pt_PT', `ClassName` = 'i18nEntity', `Created` = null, `Namespace` = null, `EntityName` = null, `FullName` = null, `Context` = null, `Status` = 'Unchanged', `Version` = 7, `TranslatingFrom` = null, `RecordID` = 52, `AuthorID` = 1721 | You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1721', `LastEdited` = now(), `OriginalLangID` = 52, `Lang` = 'pt_PT', `ClassName' at line 1,256) line 106 of MySQLDatabase.php MySQLDatabase->query(insert into `i18nEntity_lang_versions` SET `String` = 'URL mudado para \'%s\null, `LastEditorID` = '1721', `LastEdited` = now(), `OriginalLangID` = 52, `Lang` = 'pt_PT', `ClassName` = 'i18nEntity', `Created` = null, `Namespace` = null, `EntityName` = null, `FullName` = null, `Context` = null, `Status` = 'Unchanged', `Version` = 7, `TranslatingFrom` = null, `RecordID` = 52, `AuthorID` = 1721) line 360 of Database.php Database->manipulate(Array) line 92 of DB.php DB::manipulate(Array) line 567 of DataObject.php DataObject->write() line 284 of Translatable.php Translatable::write(i18nEntity,pt_PT) line 353 of i18nTranslator.php i18nTranslator->save(Array,Form) line 189 of Controller.php Controller->run(Array) line 76 of Director.php Director::direct(i18n/translate/pt_PT/) line 104 of main.php

Changed 12 months ago by ischommer

  • priority changed from medium to critical

Changed 12 months ago by ischommer

i've tried all forms of escaping there to break the produced SQL, couldn't reproduce this error. tried this on untranslated entities, and updated translated ones. seems to be happening at the end of a string - perhaps its a special linebreak-character/language-character than browsers in foreign languages insert?

Note: See TracTickets for help on using tickets.