EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/174580
Change subject: Bug: Import is not updating lastEditId
......................................................................
Bug: Import is not updating lastEditId
Change-Id: I9a24d0d03cac91fde12840b9f128115513dc689a
---
M includes/Import/Importer.php
M includes/Model/UUID.php
2 files changed, 19 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/80/174580/1
diff --git a/includes/Import/Importer.php b/includes/Import/Importer.php
index f2644f0..da64c37 100644
--- a/includes/Import/Importer.php
+++ b/includes/Import/Importer.php
@@ -171,7 +171,17 @@
/**
* @var ReflectionProperty[]
*/
- protected $postIdProperties;
+ protected $postIdProperty;
+
+ /**
+ * @var ReflectionProperty[]
+ */
+ protected $revIdProperty;
+
+ /**
+ * @var ReflectionProperty[]
+ */
+ protected $lastEditIdProperty;
/**
* @var bool
@@ -204,6 +214,8 @@
$this->postIdProperty->setAccessible( true );
$this->revIdProperty = new ReflectionProperty(
'Flow\\Model\\AbstractRevision', 'revId' );
$this->revIdProperty->setAccessible( true );
+ $this->lastEditIdProperty = new ReflectionProperty(
'Flow\\Model\\AbstractRevision', 'lastEditId' );
+ $this->lastEditIdProperty->setAccessible( true );
}
/**
@@ -288,6 +300,9 @@
}
if ( $setRevId ) {
+ if ( $revision->getRevisionId()->equals(
$revision->getLastContentEditId() ) ) {
+ $this->lastEditIdProperty->setValue( $revision,
$uid );
+ }
$this->revIdProperty->setValue( $revision, $uid );
}
}
diff --git a/includes/Model/UUID.php b/includes/Model/UUID.php
index e710325..b92df50 100644
--- a/includes/Model/UUID.php
+++ b/includes/Model/UUID.php
@@ -354,11 +354,11 @@
}
/**
- * @param UUID $other
+ * @param UUID|null $other
* @return boolean
*/
- public function equals( UUID $other ) {
- return $other->getAlphadecimal() === $this->getAlphadecimal();
+ public function equals( UUID $other = null ) {
+ return $other && $other->getAlphadecimal() ===
$this->getAlphadecimal();
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/174580
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a24d0d03cac91fde12840b9f128115513dc689a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits