Skip to content

Commit

Permalink
*6968* Check stage_id constant behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Dec 14, 2012
1 parent ec20e82 commit cac0091
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
Expand Up @@ -237,7 +237,9 @@ function getCompletedReviewCounts($journalId) {
* @return ReviewAssignment
*/
function newDataObject() {
return new ReviewAssignment();
$reviewAssignment = new ReviewAssignment();
$reviewAssignment->setStageId(1); // Ensure correct default is used
return $reviewAssignment;
}

/**
Expand Down
Expand Up @@ -99,7 +99,7 @@ function addReviewer($sectionEditorSubmission, $reviewerId, $round, $request) {
// Only add the reviewer if he has not already
// been assigned to review this article.
if (!$assigned && isset($reviewer) && !HookRegistry::call('SectionEditorAction::addReviewer', array(&$sectionEditorSubmission, $reviewerId))) {
$reviewAssignment = new ReviewAssignment();
$reviewAssignment = $reviewAssignmentDao->newDataObject();
$reviewAssignment->setReviewerId($reviewerId);
$reviewAssignment->setDateAssigned(Core::getCurrentDate());
$reviewAssignment->setRound($round);
Expand Down
5 changes: 5 additions & 0 deletions dbscripts/xml/upgrade.xml
Expand Up @@ -331,6 +331,11 @@
<note file="docs/release-notes/README-2.4.1" />
</upgrade>

<upgrade minversion="2.0.0.0" maxversion="2.4.0.0">
<data file="dbscripts/xml/upgrade/2.4.2_update.xml" />
<!-- Pending addition note file="docs/release-notes/README-2.4.2" / -->
</upgrade>

<!-- update plugin configuration - should be done as the final upgrade task -->
<code function="addPluginVersions" />
</install>
17 changes: 17 additions & 0 deletions dbscripts/xml/upgrade/2.4.2_update.xml
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data SYSTEM "../../../lib/pkp/dtd/xmlData.dtd">

<!--
* 2.4.2_update.xml
*
* Copyright (c) 2003-2012 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* 2.4.2 database updates XML file.
-->
<data>
<!-- Bug #6968: Check stage_id constant behavior -->
<sql>
<query>UPDATE review_assignments SET stage_id=1 WHERE stage_id=0</query>
</sql>
</data>

0 comments on commit cac0091

Please sign in to comment.