From 4500ebb412a88a4fb73afdeea420af357f34d9d3 Mon Sep 17 00:00:00 2001 From: Lucas Werkmeister Date: Wed, 24 May 2017 09:28:06 +0200 Subject: [PATCH] Initialize user from session MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the import script is run from the command line, there is no session, and the edit is still credited to 127.0.0.1. However, if there is a session – for example, if the import is run from a special page (#25) – this ensures that the correct user is used. --- src/EntityImporter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EntityImporter.php b/src/EntityImporter.php index ad84fd3..f8fccba 100644 --- a/src/EntityImporter.php +++ b/src/EntityImporter.php @@ -53,7 +53,7 @@ public function __construct( $this->logger = $logger; $this->idParser = new BasicEntityIdParser(); - $this->importUser = User::newFromId( 0 ); + $this->importUser = User::newFromSession(); $this->batchSize = 10; }