jenkins-bot has submitted this change and it was merged.

Change subject: Move storing of 'discussion' workflow elsewhere
......................................................................


Move storing of 'discussion' workflow elsewhere

I agree with the original comment that that place was no good.
Not sure if this new location is good, but it was where I first went looking 
for it!
(Importer.php also just stores boardWorkflow by itself)

Change-Id: I75cb51ad6ad908ab5be8c47837456fddac8e9fbb
---
M includes/Block/Header.php
M includes/Block/TopicList.php
M includes/SubmissionHandler.php
3 files changed, 6 insertions(+), 7 deletions(-)

Approvals:
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Block/Header.php b/includes/Block/Header.php
index 3c0de9d..ca67f81 100644
--- a/includes/Block/Header.php
+++ b/includes/Block/Header.php
@@ -164,6 +164,7 @@
                switch( $this->action ) {
                        case 'edit-header':
                                $this->workflow->updateLastModified( 
$this->newRevision->getRevisionId() );
+                               $this->storage->put( $this->workflow, array() 
); // 'discussion' workflow
                                $this->storage->put( $this->newRevision, array(
                                        'workflow' => $this->workflow,
                                ) );
diff --git a/includes/Block/TopicList.php b/includes/Block/TopicList.php
index 085f2e7..aa70491 100644
--- a/includes/Block/TopicList.php
+++ b/includes/Block/TopicList.php
@@ -140,7 +140,6 @@
                        throw new FailCommitException( 'Unknown commit action', 
'fail-commit' );
                }
 
-               $storage = $this->storage;
                $metadata = array(
                        'workflow' => $this->topicWorkflow,
                        'board-workflow' => $this->workflow,
@@ -148,11 +147,12 @@
                        'first-post' => $this->firstPost,
                );
 
-               $storage->put( $this->topicWorkflow, $metadata );
-               $storage->put( $this->topicListEntry, $metadata );
-               $storage->put( $this->topicTitle, $metadata );
+               $this->storage->put( $this->workflow, array() ); // 
'discussion' workflow
+               $this->storage->put( $this->topicWorkflow, $metadata ); // 
'topic' workflow
+               $this->storage->put( $this->topicListEntry, $metadata );
+               $this->storage->put( $this->topicTitle, $metadata );
                if ( $this->firstPost !== null ) {
-                       $storage->put( $this->firstPost, $metadata + array(
+                       $this->storage->put( $this->firstPost, $metadata + 
array(
                                'reply-to' => $this->topicTitle
                        ) );
                }
diff --git a/includes/SubmissionHandler.php b/includes/SubmissionHandler.php
index 6d54f2c..c0ffb89 100644
--- a/includes/SubmissionHandler.php
+++ b/includes/SubmissionHandler.php
@@ -121,8 +121,6 @@
                try {
                        $dbw->begin();
                        $cache->begin();
-                       // @todo doesn't feel right to have this here
-                       $this->storage->getStorage( 'Workflow' )->put( 
$workflow );
                        $results = array();
                        foreach ( $blocks as $block ) {
                                $results[$block->getName()] = $block->commit();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I75cb51ad6ad908ab5be8c47837456fddac8e9fbb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to