monarc-project / MonarcAppFO

MONARC - Method for an Optimised aNAlysis of Risks by @NC3-LU
https://www.monarc.lu
GNU Affero General Public License v3.0
101 stars 39 forks source link

[FrontOffice] Questions answers set leads to an error #352

Closed ruslanbaidan closed 4 days ago

ruslanbaidan commented 3 years ago

Environment Reproducible only on Lycee instance, analysis #30.

Steps to reproduce Answer on any of the questions of the second part of Context establishment: "Evaluation of Trends and Threat, and synthesis".

Context "message": "An exception occurred while executing \u0027UPDATE questions SET position = position - 1 WHERE anr_id = ? AND position \u003E= ? AND id \u003C\u003E ?\u0027 with params [\u00222a1b8133-1782-4c00-af1d-1eca3d4d6db4\u0022, 2, 431]:\n\nSQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: \u00272a1b8133-1782-4c00-af1d-1eca3d4d6db4\u0027",

Notes The code debugging and the backtrace of the issues leads to the problem in the logic of saving of the answered questions. The code of AbstractService::patch leads to execution of AbstractEntityTable::save and autopose call, which contains the reordering logic. The reordering is not needed in this case and there is an issue with the params setting inside.

Solution Implement a simple save of the patch request data in AnrQuestionService.

ruslanbaidan commented 4 days ago

Fixed within the v2.13.1