A
A
Anto2021-03-23 15:25:30
1C-Bitrix
Anto, 2021-03-23 15:25:30

How to fix an error after updating Bitrix?

Good afternoon!
After updating the version of Bitrix to the latest, and the version of php to 7.4, the following error appeared in the news component: prnt.sc/10tgcmx

Found something to swear at.

<?if(count($arItem['DISPLAY_PROPERTIES']['MORE_PHOTO_AN'])> 1):?>
      <div id="owl-demo-list-<?=$i?>" class="owl-carousel owl-theme pole-list-owl-demo" style="display: block">
          <?foreach($arItem['DISPLAY_PROPERTIES']['MORE_PHOTO_AN']['FILE_VALUE'] as $key => $arPHOTO):?>
         <?$file = CFile::ResizeImageGet($arPHOTO, array('width'=>620, 'height'=>'430'), BX_RESIZE_IMAGE_EXACT, true);?>	 
         <div class="tour-item__img">
            	<a href="<?=$arItem['DETAIL_PAGE_URL']?>">
              	<img 
              class="lazyload" 
              data-src="<?$arItem['DISPLAY_PROPERTIES']['MORE_PHOTO_AN'][FILE_VALUE][$key][SRC];?>" 
              alt="<?=$arItem["PROPERTIES"][$langId.'_NAME']["VALUE"]?>"
            />
            </a>
         </div>
        <?endforeach?>
      </div>
  <?elseif(!empty($arItem['PREVIEW_PICTURE']['SRC'])):?>
    <a href="<?=$arItem['DETAIL_PAGE_URL']?>">
      <img class="lazyload" data-src="<?=$arItem['PREVIEW_PICTURE']['SRC']?>" alt="<?=$arItem["PROPERTIES"][$langId.'_NAME']["VALUE"]?>">
    </a>
  <?elseif(empty($arItem['PREVIEW_PICTURE']['SRC'])):?>
    <a href="<?=$arItem['DETAIL_PAGE_URL']?>">
      <div class="no-photo"></div>
    </a>
  <?endif;?>

But I can not understand what is wrong, before the update everything worked as it should. Tell me what's wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
smilingcheater, 2021-03-23
@ZIROKUL

What version of PHP did you have before?
Start by replacing the use of all undeclared constants with the lines
https://www.php.net/manual/en/migration72.deprecat...
in particular:
data-src="<?$arItem['DISPLAY_PROPERTIES'][ 'MORE_PHOTO_AN']["FILE_VALUE"][$key]["SRC"];?>"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question