Skip to content

Commit 2ed8044

Browse files
committed
Merge remote-tracking branch 'mpi/MC-34522' into 2.5-bugfixes-010521
2 parents ca3506e + f09c050 commit 2ed8044

File tree

1 file changed

+6
-6
lines changed
  • app/code/Magento/ImportExport/Model/ResourceModel/Import

1 file changed

+6
-6
lines changed

app/code/Magento/ImportExport/Model/ResourceModel/Import/Data.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ private function prepareSelect(Select $select): Select
203203
// check if the table has not been overridden for backward compatibility
204204
if ($this->getMainTable() === $this->getTable('importexport_importdata')) {
205205
// user_id is NULL part is for backward compatibility
206-
$select->where('user_id=? OR user_id is NULL', $this->getCurrentUserId() ?? self::DEFAULT_USER_ID);
206+
$select->where('user_id=? OR user_id is NULL', $this->getUserId());
207207
}
208208

209209
return $select;
@@ -219,7 +219,7 @@ private function prepareInsert(array $data): array
219219
{
220220
// check if the table has not been overridden for backward compatibility
221221
if ($this->getMainTable() === $this->getTable('importexport_importdata')) {
222-
$data['user_id'] = $this->getCurrentUserId() ?? self::DEFAULT_USER_ID;
222+
$data['user_id'] = $this->getUserId();
223223
}
224224

225225
return $data;
@@ -236,7 +236,7 @@ private function prepareDelete(array $where): array
236236
// check if the table has not been overridden for backward compatibility
237237
if ($this->getMainTable() === $this->getTable('importexport_importdata')) {
238238
// user_id is NULL part is for backward compatibility
239-
$where['user_id=? OR user_id is NULL'] = $this->getCurrentUserId() ?? self::DEFAULT_USER_ID;
239+
$where['user_id=? OR user_id is NULL'] = $this->getUserId();
240240
}
241241

242242
return $where;
@@ -245,10 +245,10 @@ private function prepareDelete(array $where): array
245245
/**
246246
* Get current user ID
247247
*
248-
* @return int|null
248+
* @return int
249249
*/
250-
private function getCurrentUserId(): ?int
250+
private function getUserId(): int
251251
{
252-
return $this->authSession->isLoggedIn() ? $this->authSession->getUser()->getId() : null;
252+
return $this->authSession->isLoggedIn() ? $this->authSession->getUser()->getId() : self::DEFAULT_USER_ID;
253253
}
254254
}

0 commit comments

Comments
 (0)