Details
-
Bug
-
Resolution: Unresolved
-
None
-
None
-
High
-
Some trackchanges tag constellations lead to segment save error: 500 E1343 Setting the FieldTags tags by text led to a changed text-content presumably because the encoded tags have been improperly processed
-
Empty show more show less
Description
problem
Assume the following segment:
Bater\u00eda<del id=1> <\/del><del id=2><whitespace/></del> Batería <whitespace>
where <whitespace> stands for a 3 whitespace internal whitespace tag (so imported / pretranslated with 4 whitespaces after Batería)
The user did delete the whitespace and the whitespace tag which lead to the error.
Normally the browser would send
Bater\u00eda<del id=1> <whitespace/><\/del>
which works without any problem. Sometimes it seems that TrackChanges makes two del tags:
Bater\u00eda<del id=1> <\/del><del id=2><whitespace/><\/del>
And this leads then on backend to:
AppRoot: /var/www/translate5 Version: 7.4.1 id: 1867759 level: ERROR created: 2024-05-29 11:31:50 ecode: E1343 domain: editor.segment message: editor_Models_Segment_Exception: Setting the FieldTags tags by text led to a changed text-content presumably because the encoded tags have been improperly processed appVersion: 7.4.1 file (line): () URL: PUT https://translate5/editor/taskid/10428/segment/12596527?_dc=1716975110428&tab=1 Trace: #0 /var/www/translate5/application/modules/editor/TagSequence.php(387): editor_TagSequence->createRenderingHolder() #1 /var/www/translate5/application/modules/editor/Plugins/SpellCheck/Segment/Check.php(310): editor_TagSequence->renderReplaced('original') #2 /var/www/translate5/application/modules/editor/Segment/Numbers/Check.php(128): MittagQI\Translate5\Plugins\SpellCheck\Segment\Check::prepareTarget(Object(editor_Models_Segment), Object(editor_Segment_FieldTags)) #3 /var/www/translate5/application/modules/editor/Segment/Numbers/QualityProvider.php(98): editor_Segment_Numbers_Check->__construct(Object(editor_Models_Task), Object(editor_Models_Segment), Object(editor_Segment_FieldTags), Object(editor_Segment_FieldTags)) #4 /var/www/translate5/application/modules/editor/Segment/Quality/Manager.php(378): editor_Segment_Numbers_QualityProvider->processSegment(Object(editor_Models_Task), Object(Zend_Config), Object(editor_Segment_Tags), 'edit') #5 /var/www/translate5/application/modules/editor/Models/Segment/Updater.php(378): editor_Segment_Quality_Manager->processSegment(Object(editor_Models_Segment), Object(editor_Models_Task), 'edit') #6 /var/www/translate5/application/modules/editor/Models/Segment/Updater.php(179): editor_Models_Segment_Updater->qaBeforeSegmentSaveOnSegmentUpdate() #7 /var/www/translate5/application/modules/editor/Models/Segment/Updater.php(91): editor_Models_Segment_Updater->beforeSegmentUpdate(Object(editor_Models_SegmentHistory)) #8 /var/www/translate5/application/modules/editor/Controllers/SegmentController.php(354): editor_Models_Segment_Updater->update(Object(editor_Models_Segment), Object(editor_Models_SegmentHistory)) #9 /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Controller/Action.php(516): Editor_SegmentController->putAction() #10 /var/www/translate5/library/ZfExtended/Controllers/AAARestController.php(349): Zend_Controller_Action->dispatch('putAction') #11 /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Controller/Dispatcher/Standard.php(308): ZfExtended_RestController->dispatch('putAction') #12 /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(ZfExtended_Sanitized_HttpRequest), Object(Zend_Controller_Response_Http)) #13 /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Application/Bootstrap/Bootstrap.php(106): Zend_Controller_Front->dispatch() #14 /var/www/translate5/vendor/shardj/zf1-future/library/Zend/Application.php(400): Zend_Application_Bootstrap_Bootstrap->run() #15 /var/www/translate5/library/ZfExtended/Application.php(75): Zend_Application->run() #16 /var/www/translate5/library/ZfExtended/BaseIndex.php(170): ZfExtended_Application->run() #17 /var/www/translate5/public/index.php(35): ZfExtended_BaseIndex->startApplication() #18 {main} Extra: { "originalMarkup": "Bater\u00eda<del class=\"trackchanges ownttip deleted\" data-usertrackingid=\"42980\" data-usercssnr=\"usernr1\" data-workflowstep=\"no workflow1\" data-timestamp=\"2024-05-29T11:31:49+02:00\"> <\/del><del class=\"trackchanges ownttip deleted\" data-usertrackingid=\"42980\" data-usercssnr=\"usernr1\" data-workflowstep=\"no workflow1\" data-timestamp=\"2024-05-29T11:31:49+02:00\"><div class=\"single 73706163652074733d2232303230323022206c656e6774683d2233222f space internal-tag ownttip\"><span title=\"<1\/>: 3 whitespace characters\" class=\"short\"><1\/><\/span><span data-originalid=\"space\" data-length=\"3\" class=\"full\">\u00b7\u00b7\u00b7<\/span><\/div><\/del>", "holder": "{\"type\":\"any\",\"name\":\"span\",\"category\":\"\",\"startIndex\":0,\"endIndex\":8,\"order\":-1,\"parentOrder\":-1,\"classes\":[],\"attribs\":[]}", "container": "{\"type\":\"trackchanges\",\"name\":\"del\",\"category\":\"\",\"startIndex\":7,\"endIndex\":8,\"order\":0,\"parentOrder\":-1,\"classes\":[\"trackchanges\",\"ownttip\",\"deleted\"],\"attribs\":[{\"name\":\"data-usertrackingid\",\"value\":\"42980\"},{\"name\":\"data-usercssnr\",\"value\":\"usernr1\"},{\"name\":\"data-workflowstep\",\"value\":\"no workflow1\"},{\"name\":\"data-timestamp\",\"value\":\"2024-05-29T11:31:49+02:00\"}]}", "tag": "{\"type\":\"internal\",\"name\":\"div\",\"category\":\"\",\"startIndex\":8,\"endIndex\":8,\"order\":2,\"parentOrder\":1,\"classes\":[\"single\",\"73706163652074733d2232303230323022206c656e6774683d2233222f\",\"space\",\"internal-tag\",\"ownttip\"],\"attribs\":[],\"contentTags\":[{\"name\":\"span\",\"classes\":[\"short\"],\"attribs\":[{\"name\":\"title\",\"value\":\"<1\/>: 3 whitespace characters\"}],\"innerHtml\":\"<1\/>\"},{\"name\":\"span\",\"classes\":[\"full\"],\"attribs\":[{\"name\":\"data-originalid\",\"value\":\"space\"},{\"name\":\"data-length\",\"value\":\"3\"}],\"innerHtml\":\"\u00b7\u00b7\u00b7\"}]}", "text": "Bater\u00eda ", "segmentId": 12596527, "taskId": "10428", "taskGuid": "{74f830b4-f715-4eb6-8015-11ae6666612b}", }
According to the error message the text has a trailing whitespace.
Expectation
Since sibling del tags are valid this should not produce such an error.