diff --git a/lib/helper/AdminListHelper.php b/lib/helper/AdminListHelper.php index 41d0a59..4370e3f 100644 --- a/lib/helper/AdminListHelper.php +++ b/lib/helper/AdminListHelper.php @@ -222,7 +222,8 @@ public function __construct(array $fields, $isPopup = false) $filteredIDs[] = IntVal($id); } $this->groupActions($IDs, $_REQUEST['action']); - }elseif (isset($_REQUEST['action']) || isset($_REQUEST['action_button']) && count($this->getErrors()) == 0 ) { + } + if (isset($_REQUEST['action']) || isset($_REQUEST['action_button']) && count($this->getErrors()) == 0 ) { $listHelperClass = $this->getHelperClass(AdminListHelper::className()); $className = $listHelperClass::getModel(); $id = isset($_GET['ID']) ? $_GET['ID'] : null; @@ -1377,4 +1378,4 @@ public static function getUrl(array $params = array()) { return static::getViewURL(static::getViewName(), static::$listPageUrl, $params); } -} \ No newline at end of file +} diff --git a/lib/widget/IblockElementWidget.php b/lib/widget/IblockElementWidget.php index 9bdaa71..7948c98 100644 --- a/lib/widget/IblockElementWidget.php +++ b/lib/widget/IblockElementWidget.php @@ -83,11 +83,22 @@ public function getValueReadonly() $elementId = $this->getValue(); if (!empty($elementId)) { - $rsElement = ElementTable::getById($elementId); - $element = $rsElement->fetch(); + $rsElement = ElementTable::getList([ + 'filter' => [ + 'ID' => $elementId + ], + 'select' => [ + 'ID', + 'NAME', + 'IBLOCK_ID', + 'IBLOCK.IBLOCK_TYPE_ID', + ] + ]); + $element = $rsElement->fetch(); + return '[' . $elementId . '] ' . static::prepareToOutput($element['NAME']) . ''; } } @@ -100,11 +111,22 @@ public function generateRow(&$row, $data) $elementId = $this->getValue(); if (!empty($elementId)) { - $rsElement = ElementTable::getById($elementId); + $rsElement = ElementTable::getList([ + 'filter' => [ + 'ID' => $elementId + ], + 'select' => [ + 'ID', + 'NAME', + 'IBLOCK_ID', + 'IBLOCK.IBLOCK_TYPE_ID', + ] + ]); + $element = $rsElement->fetch(); - + $html = '[' . $elementId . '] ' . static::prepareToOutput($element['NAME']) . ''; } else { $html = ''; @@ -112,4 +134,4 @@ public function generateRow(&$row, $data) $row->AddViewField($this->getCode(), $html); } -} \ No newline at end of file +}