fixes after php8 upgrade

This commit is contained in:
merelendor 2023-02-08 20:57:38 +03:00
parent c786e5c5de
commit c90a0ca8ea
4 changed files with 8 additions and 8 deletions

View File

@ -254,7 +254,7 @@ function setCompanyForUser($ID, $REQ, $replace = false)
{
$another_user_companies = getCompaniesForUser($admin_to_remove_id, $existed_client_record['ID']);
if(count($another_user_companies) === 0)
if(gettype($another_user_companies) === "array" && count($another_user_companies) === 0)
{
\CUser::Delete($admin_to_remove_id);
}
@ -1098,7 +1098,7 @@ switch($PARAM_1)
{
$user_companies = getCompaniesForUser($removed_user_id);
if(count($user_companies) === 0)
if(gettype($user_companies) === "array" && count($user_companies) === 0)
{
\CUser::Delete($removed_user_id);
}
@ -2449,7 +2449,7 @@ switch($PARAM_1)
$questions_ar_res['PROPERTIES'] = $questions_ob_element->GetProperties();
$templates = [];
if(count($questions_ar_res['PROPERTIES']['TEMPLATE_FILE']['VALUE']) > 0)
if(gettype($questions_ar_res['PROPERTIES']['TEMPLATE_FILE']['VALUE']) === "array" && count($questions_ar_res['PROPERTIES']['TEMPLATE_FILE']['VALUE']) > 0)
{
foreach($questions_ar_res['PROPERTIES']['TEMPLATE_FILE']['VALUE'] AS $file_id)
{
@ -2474,7 +2474,7 @@ switch($PARAM_1)
"title" => $questions_ar_res['NAME'],
"answer" => $questions_ar_res['PREVIEW_TEXT'],
"request" => $questions_ar_res['PROPERTIES']['REQUEST']['VALUE_XML_ID'] == "YES" ? true : false,
"templates" => count($templates) > 0 ? $templates : null,
"templates" => gettype($templates) === "array" && count($templates) > 0 ? $templates : null,
"documents" => $questions_ar_res['PROPERTIES']['DOCUMENTS']['~VALUE'] !== "" ? $questions_ar_res['PROPERTIES']['DOCUMENTS']['~VALUE']['TEXT'] : null,
];

View File

@ -12,7 +12,7 @@
/** @var CBitrixComponent $component */
$this->setFrameMode(true);
?>
<? if(count($arResult['LEADER']) > 0): ?>
<? if($arResult['LEADER'] !== null && count($arResult['LEADER']) > 0): ?>
<div class="container container_with_filter <?= $arParams['EXTENDED'] ? "container_with_filter_with_margin" : ""; ?>" style="width: 100%; padding-top: 0px; margin-left: 0px; margin-right: 0px;">
<h2 style="margin-bottom: 24px;">Наша команда</h2>
<div class="person_comment">

View File

@ -56,7 +56,7 @@ $this->setFrameMode(true);
</div>
<form id="form_vacancy">
<div id="form_vacancy_process">
<input type="hidden" name="FORM_FIELD_VACANCY_REGION" value="<?= implode(", ", $arParams['VACANCY_REGIONS']); ?>"/>
<input type="hidden" name="FORM_FIELD_VACANCY_REGION" value="<?= gettype($arParams['VACANCY_REGIONS']) === "array" ? implode(", ", $arParams['VACANCY_REGIONS']) : ""; ?>"/>
<div class="form_field" id="FORM_FIELD_FIO_wrapper">
<input type="text" id="FORM_FIELD_FIO" name="FORM_FIELD_FIO" value="" placeholder="Фамилия, имя и отчество *"/>
</div>

View File

@ -27,12 +27,12 @@ $this->setFrameMode(true);
<h1 class="section_title"><?= $arResult['NAME']; ?></h1>
<div class="special_detail">
<div class="special_offer">
<?= $arResult['PROPERTIES']['CONTENT_HEADER']['~VALUE']['TEXT']; ?>
<?= isset($arResult['PROPERTIES']['CONTENT_HEADER']['~VALUE']['TEXT']) ? $arResult['PROPERTIES']['CONTENT_HEADER']['~VALUE']['TEXT'] : ""; ?>
<a href="#order" class="button button-blue">Отправить заявку</a>
<img src="<?= $arResult['DETAIL_PICTURE']; ?>" alt="<?= $arResult['NAME']; ?>" />
</div>
<div class="special_offer-text">
<?= $arResult['PROPERTIES']['CONTENT_TOP']['~VALUE']['TEXT']; ?>
<?= isset($arResult['PROPERTIES']['CONTENT_TOP']['~VALUE']['TEXT']) ? $arResult['PROPERTIES']['CONTENT_TOP']['~VALUE']['TEXT'] : ""; ?>
</div>
<div class="leasing_offer">
<? if(count($arResult['PROPERTIES']['CARS']['RELATED']) > 0): ?>