Skip to content

Commit 1f5b15d

Browse files
authored
Update AccountLock.php
fix for "Notice: Undefined index: lock_expires in vendor/magento/module-customer/Ui/Component/Listing/Column/AccountLock.php on line 44"
1 parent c533b3d commit 1f5b15d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/code/Magento/Customer/Ui/Component/Listing/Column/AccountLock.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ public function prepareDataSource(array $dataSource)
4141
{
4242
if (isset($dataSource['data']['items'])) {
4343
foreach ($dataSource['data']['items'] as & $item) {
44-
$lockExpires = new \DateTime($item['lock_expires']);
45-
if ($lockExpires > new \DateTime()) {
46-
$item['lock_expires'] = __('Locked');
44+
if (array_key_exists('lock_expires', $item)) {
45+
$lockExpires = new \DateTime($item['lock_expires']);
46+
if ($lockExpires > new \DateTime()) {
47+
$item['lock_expires'] = __('Locked');
48+
} else {
49+
$item['lock_expires'] = __('Unlocked');
50+
}
4751
} else {
4852
$item['lock_expires'] = __('Unlocked');
4953
}

0 commit comments

Comments
 (0)