@kostik2003
Человек творческий

Как исправить ошибку при переходе на php 8.2 Битрикс?

[TypeError]
stream_context_create(): Argument #1 ($options) must be of type ?array, string given (0)
/home/bitrix/www/bitrix/modules/sale/handlers/paysystem/paykeeper/handler.php:176
#0: stream_context_create
/home/bitrix/www/bitrix/modules/sale/handlers/paysystem/paykeeper/handler.php:176
#1: Sale\Handlers\PaySystem\PayKeeperHandler->initiatePay
/home/bitrix/www/bitrix/modules/sale/lib/paysystem/service.php:89
#2: Bitrix\Sale\PaySystem\Service->initiatePay
/home/bitrix/www/bitrix/components/bitrix/sale.order.ajax/class.php:6371
#3: SaleOrderAjax->showOrderAction
/home/bitrix/www/bitrix/components/bitrix/sale.order.ajax/class.php:6251
#4: SaleOrderAjax->doAction
/home/bitrix/www/bitrix/components/bitrix/sale.order.ajax/class.php:6524
#5: SaleOrderAjax->executeComponent
/home/bitrix/www/bitrix/modules/main/classes/general/component.php:668
#6: CBitrixComponent->includeComponent
/home/bitrix/www/bitrix/modules/main/classes/general/main.php:1195
#7: CAllMain->IncludeComponent
/home/bitrix/www/order/index.php:5
----------

дополняю:
else { //using file_get_contents
if (!ini_get('allow_url_fopen')) {
$form = "
"."INTERNAL ERROR: Option allow_url_fopen is not set in php.ini"."";
}
else {
$query_options = array("https"=>array(
"method"=>"POST",
"header"=>
"Content-type: application/x-www-form-urlencoded",
"content"=>$query));
$context = stream_context_create($query);
$form = file_get_contents($this->getOrderParams("form_url"), false, $context);
}
}

176: $context = stream_context_create($query);
  • Вопрос задан
  • 190 просмотров
Решения вопроса 1
Любые подобные ошибки совместимости в ядре решаются только обновлением Битрикса.

Ну а так, для общего развития: там явно баг и передаётся не та переменная:
- $context = stream_context_create($query);
+ $context = stream_context_create($query_options);
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы