Christopher Johnson (WMDE) has submitted this change and it was merged.

Change subject: updates to upstream 46fb646f92b12a0031105d9fc9d67df67f86dcd 
Bug:T132239
......................................................................


updates to upstream 46fb646f92b12a0031105d9fc9d67df67f86dcd
Bug:T132239

Change-Id: Ie407f643af7553db4d55ce0353c7399e1ad2b7e5
---
M src/customfield/SprintBeginDateField.php
M src/storage/BoardDataProvider.php
M src/storage/SprintColumnTransaction.php
M src/view/burndown/SprintDataView.php
4 files changed, 43 insertions(+), 31 deletions(-)

Approvals:
  Christopher Johnson (WMDE): Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/customfield/SprintBeginDateField.php 
b/src/customfield/SprintBeginDateField.php
index dcfe987..439d9f7 100644
--- a/src/customfield/SprintBeginDateField.php
+++ b/src/customfield/SprintBeginDateField.php
@@ -20,6 +20,10 @@
     return 'isdc:sprint:startdate';
   }
 
+  public function getModernFieldKey() {
+    return 'startdate';
+  }
+
   public function getFieldName() {
     return 'Sprint Start Date';
   }
diff --git a/src/storage/BoardDataProvider.php 
b/src/storage/BoardDataProvider.php
index 3a3729e..5efe05e 100644
--- a/src/storage/BoardDataProvider.php
+++ b/src/storage/BoardDataProvider.php
@@ -168,7 +168,7 @@
     $scope_phid = $this->project->getPHID();
     $task_phids = mpull($this->tasks, 'getPHID');
     $query = new ManiphestTransactionQuery();
-    
$query->withTransactionTypes(array(ManiphestTransaction::TYPE_PROJECT_COLUMN));
+    $query->withTransactionTypes(array(PhabricatorTransactions::TYPE_COLUMNS));
     $query->withObjectPHIDs($task_phids);
     $query->setViewer($this->viewer);
     $col_xactions = $query->execute();
@@ -176,9 +176,10 @@
       $xaction_date = $xaction->getDateCreated();
       if ($xaction_date >= $this->start && $xaction_date <= $this->end) {
         $newval = $xaction->getNewValue();
-        if ($newval['projectPHID'] == $scope_phid) {
-            $xactions[] = $xaction;
-        }
+          $newArr = call_user_func_array('array_merge', $newval);
+              if ($newArr['boardPHID'] == $scope_phid) {
+                  $xactions[] = $xaction;
+              }
       }
     }
     return $xactions;
diff --git a/src/storage/SprintColumnTransaction.php 
b/src/storage/SprintColumnTransaction.php
index cfbfa09..a5de31f 100644
--- a/src/storage/SprintColumnTransaction.php
+++ b/src/storage/SprintColumnTransaction.php
@@ -63,7 +63,7 @@
             break;
           case 'reopen':
             $this->reopenedTasksToday($date, $dates);
-            $this->reopenedPointsToday($date, $points, $dates);
+           // $this->reopenedPointsToday($date, $points, $dates);
             break;
         }
       }
@@ -91,24 +91,25 @@
   }
 
   private function setXActionEventType($old_col_name, $new_col_name) {
-    $old_is_closed = ($old_col_name === null) ||
-        SprintConstants::TYPE_CLOSED_STATUS_COLUMN == $old_col_name;
+    $old_is_closed = ($old_col_name = 
SprintConstants::TYPE_CLOSED_STATUS_COLUMN and $new_col_name != 
SprintConstants::TYPE_CLOSED_STATUS_COLUMN);
 
     if ($old_is_closed) {
       return 'reopen';
-    } else {
+    } else if ($new_col_name) {
       switch ($new_col_name) {
-        case SprintConstants::TYPE_CLOSED_STATUS_COLUMN:
-          return 'close';
-        case SprintConstants::TYPE_REVIEW_STATUS_COLUMN:
-          return 'review';
-        case SprintConstants::TYPE_DOING_STATUS_COLUMN:
-          return 'doing';
-        case SprintConstants::TYPE_BACKLOG_STATUS_COLUMN:
-          return 'backlog';
-        default:
-          break;
+          case SprintConstants::TYPE_CLOSED_STATUS_COLUMN:
+              return 'close';
+          case SprintConstants::TYPE_REVIEW_STATUS_COLUMN:
+              return 'review';
+          case SprintConstants::TYPE_DOING_STATUS_COLUMN:
+              return 'doing';
+          case SprintConstants::TYPE_BACKLOG_STATUS_COLUMN:
+              return 'backlog';
+          default:
+              break;
       }
+    } else {
+    return null;
     }
   }
 
@@ -118,22 +119,28 @@
     $new_col_name = null;
     $events = array();
     foreach ($xactions as $xaction) {
-      $old_col_phid = idx($xaction->getOldValue(), 'columnPHIDs');
-      foreach ($old_col_phid as $phid) {
-        $old_col = $this->query->getColumnforPHID($phid);
-        foreach ($old_col as $obj) {
-          $old_col_name = $obj->getDisplayName();
+      $oldval = $xaction->getOldValue();
+      if (!empty($oldval)) {
+        $newArr = call_user_func_array('array_merge', $oldval);
+        $old_col_phid = idx($newArr, 'columnPHID');
+        foreach ($old_col_phid as $phid) {
+          $old_col = $this->query->getColumnforPHID($phid);
+          foreach ($old_col as $obj) {
+            $old_col_name = $obj->getDisplayName();
+          }
         }
       }
-      $new_col_phid = idx($xaction->getNewValue(), 'columnPHIDs');
-      foreach ($new_col_phid as $phid) {
-        $new_col = $this->query->getColumnforPHID($phid);
-        foreach ($new_col as $obj) {
-          $new_col_name = $obj->getDisplayName();
-        }
+      $newval = $xaction->getNewValue();
+      if (!empty($newval)) {
+        $newArr = call_user_func_array('array_merge', $newval);
+        $new_col_phid = idx($newArr, 'columnPHID');
+        $xaction_scope_phid = idx($newArr, 'boardPHID');
+          $new_col = $this->query->getColumnforPHID($new_col_phid);
+          foreach ($new_col as $obj) {
+            $new_col_name = $obj->getDisplayName();
+          }
       }
       $scope_phid = $this->project->getPHID();
-      $xaction_scope_phid = idx($xaction->getNewValue(), 'projectPHID');
       if ($scope_phid == $xaction_scope_phid) {
         $event_type = $this->setXActionEventType($old_col_name, $new_col_name);
         if ($event_type !== null) {
diff --git a/src/view/burndown/SprintDataView.php 
b/src/view/burndown/SprintDataView.php
index 4b4b06d..67b1d37 100644
--- a/src/view/burndown/SprintDataView.php
+++ b/src/view/burndown/SprintDataView.php
@@ -19,7 +19,7 @@
     return $this;
   }
 
-  public function setViewer($viewer) {
+  public function setViewer(PhabricatorUser $viewer) {
     $this->viewer = $viewer;
     return $this;
   }

-- 
To view, visit https://gerrit.wikimedia.org/r/282675
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie407f643af7553db4d55ce0353c7399e1ad2b7e5
Gerrit-PatchSet: 1
Gerrit-Project: phabricator/extensions/Sprint
Gerrit-Branch: master
Gerrit-Owner: Christopher Johnson (WMDE) <christopher.john...@wikimedia.de>
Gerrit-Reviewer: Christopher Johnson (WMDE) <christopher.john...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to