X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fimport%2FImportableUploadRevisionImporter.php;h=95a171b8a7d516894813a4570b3a68680a104b44;hb=2589076e3bea2e9535c089d7ff816de70daa5af5;hp=b64114cf87beedadcb4d0003e2275b0cf12a017c;hpb=c8f77e97faaecfb656042554fdc4d60d32ad39e8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/import/ImportableUploadRevisionImporter.php b/includes/import/ImportableUploadRevisionImporter.php index b64114cf87..95a171b8a7 100644 --- a/includes/import/ImportableUploadRevisionImporter.php +++ b/includes/import/ImportableUploadRevisionImporter.php @@ -17,6 +17,11 @@ class ImportableUploadRevisionImporter implements UploadRevisionImporter { */ private $enableUploads; + /** + * @var bool + */ + private $shouldCreateNullRevision = true; + /** * @param bool $enableUploads * @param LoggerInterface $logger @@ -29,6 +34,16 @@ class ImportableUploadRevisionImporter implements UploadRevisionImporter { $this->logger = $logger; } + /** + * Setting this to false will deactivate the creation of a null revision as part of the upload + * process logging in LocalFile::recordUpload2, see T193621 + * + * @param bool $shouldCreateNullRevision + */ + public function setNullRevisionCreation( $shouldCreateNullRevision ) { + $this->shouldCreateNullRevision = $shouldCreateNullRevision; + } + /** * @return StatusValue */ @@ -100,7 +115,9 @@ class ImportableUploadRevisionImporter implements UploadRevisionImporter { $flags, false, $importableRevision->getTimestamp(), - $user + $user, + [], + $this->shouldCreateNullRevision ); }