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

Change subject: Render posts against the owner page rather than topic
......................................................................


Render posts against the owner page rather than topic

We have been rendering pages relative to their topic, under the assumption
that we might move the post around and show it in multiple places, but the
Topic would always be its canonical location.  Users don't particularly like
the uuid titles anyways so those will end up going away at some time and
becoming dynamic.  Lets redefine a post as being relative to the page the
topic was created at.

Note that this does not update old revisions, but any edited content will
receive the new treatment.

Bug: T75409
Change-Id: Ied9657e74e129f07ebe5a6218a3b6480dea43a8f
---
M includes/Collection/AbstractCollection.php
M includes/Model/AbstractRevision.php
M includes/Parsoid/ContentFixer.php
3 files changed, 12 insertions(+), 3 deletions(-)

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



diff --git a/includes/Collection/AbstractCollection.php 
b/includes/Collection/AbstractCollection.php
index 4db16dc..114d2d9 100644
--- a/includes/Collection/AbstractCollection.php
+++ b/includes/Collection/AbstractCollection.php
@@ -220,6 +220,15 @@
        }
 
        /**
+        * Returns the Title object this revision was created at.
+        *
+        * @return Title
+        */
+       public function getOwnerTitle() {
+               return $this->getWorkflow()->getOwnerTitle();
+       }
+
+       /**
         * Returns the workflow object this collection is associated with.
         *
         * @return Workflow
diff --git a/includes/Model/AbstractRevision.php 
b/includes/Model/AbstractRevision.php
index f1af62a..1717337 100644
--- a/includes/Model/AbstractRevision.php
+++ b/includes/Model/AbstractRevision.php
@@ -356,7 +356,7 @@
                                        $sourceFormat,
                                        $format,
                                        $raw,
-                                       $this->getCollection()->getTitle()
+                                       $this->getCollection()->getOwnerTitle()
                                );
                        }
                }
@@ -428,7 +428,7 @@
                                $inputFormat,
                                $storageFormat,
                                $content,
-                               $title ?: $this->getCollection()->getTitle()
+                               $title ?: 
$this->getCollection()->getOwnerTitle()
                        );
                }
 
diff --git a/includes/Parsoid/ContentFixer.php 
b/includes/Parsoid/ContentFixer.php
index a4e2223..cbe7a63 100644
--- a/includes/Parsoid/ContentFixer.php
+++ b/includes/Parsoid/ContentFixer.php
@@ -48,7 +48,7 @@
        public function getContent( AbstractRevision $revision ) {
                return $this->apply(
                        $revision->getContent( 'html' ),
-                       $revision->getCollection()->getTitle()
+                       $revision->getCollection()->getOwnerTitle()
                );
        }
 

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

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

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

Reply via email to