• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/config/state.php
  • Класс: BitrixCatalogConfigState
  • Вызов: State::handlerBeforeIblockElementAdd
static function handlerBeforeIblockElementAdd(array &$fields): bool
{
	if (!self::checkIblockId($fields))
	{
		return true;
	}

	$limit = self::checkIblockLimit((int)$fields['IBLOCK_ID']);
	if (empty($limit))
	{
		return true;
	}

	if (!isset($fields['IBLOCK_SECTION']) || !is_array($fields['IBLOCK_SECTION']))
	{
		return true;
	}
	$sections = $fields['IBLOCK_SECTION'];
	MainTypeCollection::normalizeArrayValuesByInt($sections, true);
	if (empty($sections))
	{
		return true;
	}
	self::loadIblockSections((int)$fields['IBLOCK_ID']);
	$sections = array_intersect($sections, self::$fullIblockSections);
	if (empty($sections))
	{
		return true;
	}
	unset($sections);

	self::setProductLimitError($limit['MESSAGE']);
	unset($limit);

	return false;
}