R
R
redesupar2022-03-09 09:46:46
1C-Bitrix
redesupar, 2022-03-09 09:46:46

How to remove Bitrix error?

I created a second site on the same Bitrix license, everything is set up, everything is ok, but there are problems with the custom search module.
When searching, it gives an error on a new site, and in another it works fine

[Error] 
Call to undefined function getElProp() (0)
/home/bitrix/ext_www/site2.ru/local/templates/aspro_max/components/bitrix/search.page/search/result_modifier.php:9
#0: include
  /home/bitrix/ext_www/site1.ru/bitrix/modules/main/classes/general/component_template.php:947
#1: CBitrixComponentTemplate->__IncludeMutatorFile(array, array)
  /home/bitrix/ext_www/site1.ru/bitrix/modules/main/classes/general/component_template.php:854
#2: CBitrixComponentTemplate->IncludeTemplate(array)
  /home/bitrix/ext_www/site1.ru/bitrix/modules/main/classes/general/component.php:766
#3: CBitrixComponent->showComponentTemplate()
  /home/bitrix/ext_www/site1.ru/bitrix/components/bitrix/search.page/component.php:396
#4: include(string)
  /home/bitrix/ext_www/site1.ru/bitrix/modules/main/classes/general/component.php:605
#5: CBitrixComponent->__includeComponent()
  /home/bitrix/ext_www/site1.ru/bitrix/modules/main/classes/general/component.php:682
#6: CBitrixComponent->includeComponent(string, array, boolean, boolean)
  /home/bitrix/ext_www/site1.ru/bitrix/modules/main/classes/general/main.php:1068
#7: CAllMain->IncludeComponent(string, string, array, boolean)
  /home/bitrix/ext_www/site2.ru/search/index.php:56

The result_modifier.php file Gives an
error to getelprop, if they are removed, it works, but does not display the product name through aritem["name"]
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();?>
<?
if($arResult["SEARCH"] )
{
  global $arRegion, $arTheme;
  foreach($arResult["SEARCH"] as $key => &$arSearch)
  {

    $arSearch["TITLE_CUSTOM"]=getElProp("TITLE_CUSTOM", $arSearch["ITEM_ID"]);

    $arSearch["CML2_ARTICLE"]=getElProp("CML2_ARTICLE", $arSearch["ITEM_ID"]);
    $arSearch["TSVET"]=getElPropList("TSVET", $arSearch["ITEM_ID"]);
    $arSearch["KOMPLEKTATSIYA_PERVICHNAYA_UPAKOVKA"]=getElProp("TITLE_CUSTOM", $arSearch["ITEM_ID"]);
    $arSearch["TRANSPORTNAYA_UPAKOVKA"]=getElPropList("TRANSPORTNAYA_UPAKOVKA", $arSearch["ITEM_ID"]);

  
    
    if(strpos($arSearch["URL_WO_PARAMS"], "#YEAR#") !== false)
    {
      if($arSearch["DATE_CHANGE"])
      {
        if($arDateTime = ParseDateTime($arSearch["DATE_CHANGE"], FORMAT_DATETIME))
        {
          $url = str_replace("#YEAR#", $arDateTime['YYYY'], $arSearch["URL_WO_PARAMS"]);
          if($arResult["NAV_RESULT"]->url_add_params)
            $url.= "?".implode("&", $arResult["NAV_RESULT"]->url_add_params);
          $arResult["SEARCH"][$key]["URL"] = $url;
        }
      }
    }
    if($arSearch['MODULE_ID'] == 'iblock')
    {
      if(strpos($arSearch['URL'], $arTheme['CATALOG_PAGE_URL']['VALUE']) !== false)
        unset($arResult["SEARCH"][$key]);
      if($arRegion)
      {
        $arRegionProps = array();
        $rsPropRegion = CIBlockElement::GetProperty($arSearch["PARAM2"], $arSearch["ITEM_ID"], array("sort" => "asc"), Array("CODE"=>"LINK_REGION"));
        while($arPropRegion = $rsPropRegion->Fetch())
        {
          if($arPropRegion['VALUE'])
            $arRegionProps[] = $arPropRegion['VALUE'];
        }
        if($arRegionProps)
        {
          if(!in_array($arRegion['ID'], $arRegionProps))
          {
            unset($arResult["SEARCH"][$key]);
          }
        }
      }
    }
  }
}
?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2022-03-09
@redesupar

Call to undefined function getElProp() == Call to undefined function getElProp()
You have not defined a function. Find it on the first site and transfer it to the second one and it will work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question