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

Change subject: Always include post-id in API response
......................................................................


Always include post-id in API response

Current JS code isn't using this param anyway, but I thought
it would be more useful to always have it available.

I can think of only 1 reason to include it conditionally:
to distinguish between "it's a new post" and operations on
existing posts.
That same thing can already be accomplished by checking action
(response always come in flow.<action>.data form)

Change-Id: Ib6875cc95459ae34a6be4012f1debf69c69be127
---
M includes/Block/Topic.php
1 file changed, 1 insertion(+), 4 deletions(-)

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



diff --git a/includes/Block/Topic.php b/includes/Block/Topic.php
index 5b5c792..e753b63 100644
--- a/includes/Block/Topic.php
+++ b/includes/Block/Topic.php
@@ -426,7 +426,6 @@
                                throw new FailCommitException( 'Attempt to save 
null revision', 'fail-commit' );
                        }
 
-
                        $metadata = $this->extraCommitMetadata + array(
                                'workflow' => $this->workflow,
                                'topic-title' => $this->loadTopicTitle(),
@@ -455,11 +454,9 @@
                        }
 
                        $returnMetadata = array(
+                               'post-id' => $this->newRevision->getPostId(),
                                'post-revision-id' => 
$this->newRevision->getRevisionId(),
                        );
-                       if ( $this->newRevision->isFirstRevision() ) {
-                               $returnMetadata['post-id'] = 
$this->newRevision->getPostId();
-                       }
 
                        return $returnMetadata;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6875cc95459ae34a6be4012f1debf69c69be127
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