Matthias Mullie has uploaded a new change for review. https://gerrit.wikimedia.org/r/193092
Change subject: Fix fatal on post diff page ...................................................................... Fix fatal on post diff page UUID objects were assumed in the code, but it was getting strings. Not sure if the fatal is actually happening in production (I noticed because my DB is corrupt and some id couldn't be loaded), but this should be fixed properly anyway. Change-Id: Ie10839cc24dc6e1b9b0aacf610a6e34fbc314b52 --- M includes/Block/Header.php M includes/Block/Topic.php M includes/Block/TopicSummary.php M includes/Formatter/RevisionViewQuery.php 4 files changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/92/193092/1 diff --git a/includes/Block/Header.php b/includes/Block/Header.php index 5ccc47c..189d8e6 100644 --- a/includes/Block/Header.php +++ b/includes/Block/Header.php @@ -10,6 +10,7 @@ use Flow\Formatter\RevisionViewFormatter; use Flow\Formatter\FormatterRow; use Flow\Model\Header; +use Flow\Model\UUID; use Flow\RevisionActionPermissions; use Flow\UrlGenerator; use IContextSource; @@ -240,7 +241,7 @@ } /** @var HeaderViewQuery $query */ $query = Container::get( 'query.header.view' ); - list( $new, $old ) = $query->getDiffViewResult( $options['newRevision'], $oldRevision ); + list( $new, $old ) = $query->getDiffViewResult( UUID::create( $options['newRevision'] ), UUID::create( $oldRevision ) ); /** @var RevisionDiffViewFormatter $formatter */ $formatter = Container::get( 'formatter.revision.diff.view' ); diff --git a/includes/Block/Topic.php b/includes/Block/Topic.php index e7c4576..62db763 100644 --- a/includes/Block/Topic.php +++ b/includes/Block/Topic.php @@ -554,11 +554,11 @@ if ( !isset( $options['newRevision'] ) ) { throw new InvalidInputException( 'A revision must be provided for comparison', 'revision-comparison' ); } - $oldRevision = ''; + $oldRevision = null; if ( isset( $options['oldRevision'] ) ) { $oldRevision = $options['oldRevision']; } - list( $new, $old ) = Container::get( 'query.post.view' )->getDiffViewResult( $options['newRevision'], $oldRevision ); + list( $new, $old ) = Container::get( 'query.post.view' )->getDiffViewResult( UUID::create( $options['newRevision'] ), UUID::create( $oldRevision ) ); return array( 'revision' => Container::get( 'formatter.revision.diff.view' )->formatApi( $new, $old, $this->context ) diff --git a/includes/Block/TopicSummary.php b/includes/Block/TopicSummary.php index 0e638ee..51b048a 100644 --- a/includes/Block/TopicSummary.php +++ b/includes/Block/TopicSummary.php @@ -13,6 +13,7 @@ use Flow\Formatter\RevisionViewFormatter; use Flow\Model\PostRevision; use Flow\Model\PostSummary; +use Flow\Model\UUID; use IContextSource; use Message; @@ -269,11 +270,11 @@ if ( !isset( $options['newRevision'] ) ) { throw new InvalidInputException( 'A revision must be provided for comparison', 'revision-comparison' ); } - $oldRevision = ''; + $oldRevision = null; if ( isset( $options['oldRevision'] ) ) { $oldRevision = $options['newRevision']; } - list( $new, $old ) = Container::get( 'query.postsummary.view' )->getDiffViewResult( $options['newRevision'], $oldRevision ); + list( $new, $old ) = Container::get( 'query.postsummary.view' )->getDiffViewResult( UUID::create( $options['newRevision'] ), UUID::create( $oldRevision ) ); $output['revision'] = Container::get( 'formatter.revision.diff.view' )->formatApi( $new, $old, $this->context ); break; } diff --git a/includes/Formatter/RevisionViewQuery.php b/includes/Formatter/RevisionViewQuery.php index c2352a3..05e97a0 100644 --- a/includes/Formatter/RevisionViewQuery.php +++ b/includes/Formatter/RevisionViewQuery.php @@ -44,7 +44,7 @@ * @throws InvalidInputException * @throws PermissionException */ - public function getDiffViewResult( $curId, $prevId = null ) { + public function getDiffViewResult( UUID $curId, UUID $prevId = null ) { $cur = $this->createRevision( $curId ); if ( !$cur ) { throw new InvalidInputException( 'Could not find revision: ' . $curId, 'missing-revision' ); -- To view, visit https://gerrit.wikimedia.org/r/193092 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie10839cc24dc6e1b9b0aacf610a6e34fbc314b52 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Matthias Mullie <mmul...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits