Editor record decision

Hi
in OJs 2.3.5 when editor decides to record a decision, sometimes this decision inserts in db more than one time , for example 4 or 5 times, I can not understand why this happens , so I tried to add sleep(1) in order to prevent it and as I think this problem happens when the query has not executed completely, is this work right ?

for ($i = 1; $i <= $sectionEditorSubmission->getCurrentRound(); $i++) {
            $editorDecisions = $sectionEditorSubmission->getDecisions($i);
            if (is_array($editorDecisions)) {
                foreach ($editorDecisions as $editorDecision) {
                    if ($editorDecision['editDecisionId'] == null) {//echo $i;die('**');
                        $this->update(
                            sprintf('INSERT INTO edit_decisions
                                (article_id, round, editor_id, decision, date_decided)
                                VALUES (?, ?, ?, ?, %s)',
                                $this->datetimeToDB($editorDecision['dateDecided'])),
                            array($sectionEditorSubmission->getArticleId(), $sectionEditorSubmission->getCurrentRound(), $editorDecision['editorId'], $editorDecision['decision'])
                        );sleep(1);
                    }
                }
            }
        }

Hi @Marya_Mohammadi,

OJS 2.3.5 is very old – I’d strongly suggest upgrading to the latest 2.4.x before spending time debugging this further. That’ll likely solve the issue and give you numerous new features/fixes at the same time.

Regards,
Alec Smecher
Public Knowledge Project Team