Matthias Mullie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/205612

Change subject: Remove workaround code from when pageid could still be 0
......................................................................

Remove workaround code from when pageid could still be 0

Change-Id: I0148c71dafef6f54069403df72c30a9640afda34
---
M includes/BoardMover.php
M includes/Model/Workflow.php
2 files changed, 2 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/12/205612/1

diff --git a/includes/BoardMover.php b/includes/BoardMover.php
index 6f2e603..58552d1 100644
--- a/includes/BoardMover.php
+++ b/includes/BoardMover.php
@@ -75,11 +75,7 @@
                // revisit this.
                $found = $this->storage->find( 'Workflow', array(
                        'workflow_wiki' => wfWikiId(),
-                       // @todo once workflow_page_id is reliable we can 
search for only
-                       // the page id and skip the namespace/title text
-                       'workflow_namespace' => $oldTitle->getNamespace(),
-                       'workflow_title_text' => $oldTitle->getDBkey(),
-                       'workflow_page_id' => array( 0, 
$oldTitle->getArticleID() ),
+                       'workflow_page_id' => $oldTitle->getArticleID(),
                ) );
                if ( !$found ) {
                        throw new FlowException( "Could not locate workflow for 
$oldTitle" );
diff --git a/includes/Model/Workflow.php b/includes/Model/Workflow.php
index b9ae475..4b8ebc0 100644
--- a/includes/Model/Workflow.php
+++ b/includes/Model/Workflow.php
@@ -182,14 +182,7 @@
         * @throws DataModelException
         */
        public function updateFromTitle( Title $oldTitle, Title $newTitle ) {
-               // temporary hack. @todo write maintenance script to fix all of 
these
-               if ( $this->pageId === 0 ) {
-                       if ( $this->getOwnerTitle()->equals( $oldTitle ) ) {
-                               $this->pageId = $oldTitle->getArticleID();
-                       } else {
-                               throw new DataModelException( "The provided 
oldTitle ({$oldTitle->getPrefixedDBkey()}) does not match this workflow." );
-                       }
-               } elseif ( $oldTitle->getArticleID() !== $this->pageId ) {
+               if ( $oldTitle->getArticleID() !== $this->pageId ) {
                        throw new DataModelException( 'Must update from title 
with same page id. ' . $this->pageId . ' !== ' . $oldTitle->getArticleID() );
                }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0148c71dafef6f54069403df72c30a9640afda34
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to