From 1140f796637efa309968e6131c45ef8ddec0e36a Mon Sep 17 00:00:00 2001 From: zhouxin Date: Tue, 15 Mar 2022 09:07:58 +0000 Subject: [PATCH 1/2] Fix bug #18306. --- module/testtask/control.php | 2 +- module/testtask/js/common.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index c6c813701d..cbd1390f7a 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -876,7 +876,7 @@ class testtask extends control $this->executeHooks($taskID); - if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent.parent')); return $this->send(array('result' => 'success', 'message' => $this->lang->success, 'locate' => $this->createLink('testtask', 'view', "taskID=$taskID"))); } diff --git a/module/testtask/js/common.js b/module/testtask/js/common.js index 58db9227d1..7a2db64b9d 100644 --- a/module/testtask/js/common.js +++ b/module/testtask/js/common.js @@ -11,6 +11,10 @@ $(document).ready(function() parent.$.cookie('selfClose', 1); setTimeout(function(){parent.$.closeModal(null, 'this')}, 1200); } + else if(response.locate == 'parent.parent') + { + setTimeout(function(){parent.location.reload();}, 1200); + } else { setTimeout(function(){window.location.href = response.locate;}, 1200); From f6a75777491a841b529fc5836bcf12960c0360fb Mon Sep 17 00:00:00 2001 From: zhouxin Date: Wed, 16 Mar 2022 01:39:05 +0000 Subject: [PATCH 2/2] Fix bug #18306. --- module/bug/control.php | 2 +- module/story/control.php | 2 +- module/story/model.php | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 6245d24d50..2ba17c5d0b 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1701,7 +1701,7 @@ class bug extends control } else { - return print(js::closeModal('parent.parent')); + return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); } } if(defined('RUN_MODE') && RUN_MODE == 'api') diff --git a/module/story/control.php b/module/story/control.php index 7dece2cbe1..d722970c44 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1378,7 +1378,7 @@ class story extends control } else { - return print(js::closeModal('parent.parent', 'this')); + return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); } } diff --git a/module/story/model.php b/module/story/model.php index b41f7b0dc2..2274921c13 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1542,8 +1542,11 @@ class storyModel extends model ->where('id')->eq($storyID)->exec(); /* Update parent story status and stage. */ - if($oldStory->parent > 0) $this->updateParentStatus($storyID, $oldStory->parent); - $this->setStage($oldStory->parent); + if($oldStory->parent > 0) + { + $this->updateParentStatus($storyID, $oldStory->parent); + $this->setStage($oldStory->parent); + } if(!dao::isError()) $this->loadModel('score')->create('story', 'close', $storyID); return common::createChanges($oldStory, $story); }