| Цитата | ||||
|---|---|---|---|---|
написал:
Тут пример официальный с условием
Свойства, методы и константы, объявленные без явного ключевого слова области видимости, определяются как общедоступные (public). |
|
Подскажите как правильно поправить код.
Оригинал: "CUser::IsAuthorized()" Правка: $USER->IsAuthorized(); или "$USER->IsAuthorized();" Я имею ввиду кавычки нужны или нет? Оба варианта рабочие, только вот хочется чтобы верно было)) Такой же вопрос про: public static function и static function Как правильно писать? Оба варианта рабочие. |
|
|
|
|
<input type="hidden" id="column_headers" value="<?=htmlspecialcharsbx(implode($arHeaders, ","))?>" /> Что в ней не так для 8,1? Нашел решения своей же проблемы (Argument #2 ($array) must be of type ?array, string given (0)), публикую для остальных: Оригинал строки: <input type="hidden" id="column_headers" value="<?=htmlspecialcharsbx(implode($arHeaders, ","))?>" /> Правильный вариант для 8,1: <input type="hidden" id="column_headers" value="<?=htmlspecialcharsbx(implode(",", $arHeaders))?>" /> Разделитель и массив поменялись местами с версии 7.4.0 |
|||||||||
|
|
|
|
|||||
|
|
|
|
|||||||||
|
|
|
|
Новая ошибка(( В корзине нельзя произвести оформление заказа, в коде написано красным это:
<input type="hidden" id="column_headers" value="<pre>[TypeError] implode(): Argument #2 ($array) must be of type ?array, string given (0) /home/bitrix/www/local/templates/lumpos_default/components/b #0: implode /home/bitrix/www/local/templates/lumpos_default/components/b #1: include(string) /home/bitrix/www/local/templates/lumpos_default/components/b #2: include(string) /home/bitrix/www/bitrix/modules/main/classes/general/compone #3: CBitrixComponentTemplate->__IncludePHPTemplate /home/bitrix/www/bitrix/modules/main/classes/general/compone #4: CBitrixComponentTemplate->IncludeTemplate /home/bitrix/www/bitrix/modules/main/classes/general/compone #5: CBitrixComponent->showComponentTemplate /home/bitrix/www/bitrix/modules/main/classes/general/compone #6: CBitrixComponent->includeComponentTemplate /home/bitrix/www/bitrix/components/bitrix/sale.basket.basket/class.php:584 #7: CBitrixBasketComponent->initialLoadAction /home/bitrix/www/bitrix/components/bitrix/sale.basket.basket/class.php:574 #8: CBitrixBasketComponent->doAction /home/bitrix/www/bitrix/components/bitrix/sale.basket.basket/class.php:976 #9: CBitrixBasketComponent->executeComponent /home/bitrix/www/bitrix/modules/main/classes/general/compone #10: CBitrixComponent->includeComponent /home/bitrix/www/bitrix/modules/main/classes/general/main.php:1062 #11: CAllMain->IncludeComponent /home/bitrix/www/personal/cart/index.php:62 ---------- </pre> |
|
|
|
|
|
|||||||||||||||||||
|
|
|
А то не понятно(( Какой параметр нужно найти у меня, чтобы изменить его на $USER->IsAutorized" Знаний не хватает, увы(( |
|||||||||||||
|
|
|
|
|||||||||||||
|
|
|
class CAllUser extends CDBResult Верный тогда получается класс? Просто добавляю static к function? |
|||||||||
|
|
|
|
|||||
|
|
|
|
Теперь выходит такая ошибка:
[TypeError] call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method CScoderCollectionsEvents::OnBeforePrologHandler() cannot be called statically (0) /home/bitrix/www/bitrix/modules/main/classes/general/module.php:480 #0: ExecuteModuleEventEx /home/bitrix/www/bitrix/modules/main/include.php:456 #1: require_once(string) /home/bitrix/www/bitrix/modules/main/include/prolog_before.php:14 #2: require_once(string) /home/bitrix/www/bitrix/modules/main/include/prolog.php:10 #3: require_once(string) /home/bitrix/www/bitrix/header.php:1 #4: require(string) /home/bitrix/www/index.php:2 ---------- Единственное место с упоминанием "OnBeforePrologHandler" это: } if ($return === true) { //если товар еще не принадлежит разделу коллекции if (!in_array($arCollection["SECTION_ID"],$arSections)) { $arGroupsSet[] = $arCollection["SECTION_ID"]; foreach (GetModuleEvents("scoder.collections", "OnBeforeScoderCollectionElementEdit", true) as $arEvent) ExecuteModuleEventEx($arEvent, array($return, $ELEMENT_ID, $arCollection["SECTION_ID"], $arSections, &$arGroupsSet)); CIBlockElement::SetElementSection($ELEMENT_ID, $arGroupsSet); //Переиндексация PropertyIndex\Manager::updateElementIndex($arProduct["IBLOCK_ID"], $ELEMENT_ID); } } elseif ($return !== true && is_array($arSections) && in_array($arCollection["SECTION_ID"],$arSections)) //Сброс товара. Если товар лежит в коллекции, но не должен там лежать { $arSectionsNew = array(); foreach ($arSections as $section_id) if ($section_id != $arCollection["SECTION_ID"]) $arSectionsNew[] = $section_id; foreach (GetModuleEvents("scoder.collections", "OnBeforeScoderCollectionElementEdit", true) as $arEvent) ExecuteModuleEventEx($arEvent, array($return, $ELEMENT_ID, $arCollection["SECTION_ID"], $arSections, &$arSectionsNew)); CIBlockElement::SetElementSection($ELEMENT_ID, $arSectionsNew); //Переиндексация PropertyIndex\Manager::updateElementIndex($arProduct["IBLOCK_ID"], $ELEMENT_ID); } } } По инструкции, необходимо дописать static function, но тут нет ничего подобного. Можете подсказать, что поправить. |
|
|
|
|
[TypeError] call_user_func_array(): Argument #1 ($callback) must be a valid callback, class "\Artmix\Handlers\Main\OnPageStart" not found (0) /home/bitrix/www/bitrix/modules/main/classes/general/module.php:465 #0: ExecuteModuleEventEx /home/bitrix/www/bitrix/modules/main/include.php:159 #1: require_once(string) /home/bitrix/www/bitrix/modules/main/include/prolog_before.php:14 #2: require_once(string) /home/bitrix/www/bitrix/modules/main/include/prolog.php:10 #3: require_once(string) /home/bitrix/www/bitrix/header.php:1 #4: require(string) /home/bitrix/www/index.php:2 ---------- После изменил на второй вариант: static function МетодКласса() и ошибка пропала по данному модулю, вышла по следующему)) Разбираюсь дальше. |
|||||||||
|
|
|
|
Можете помочь, не получается определить мешающий модуль:
[TypeError] call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method Artmix\Handlers\Main\OnPageStart::checkReCaptcha() cannot be called statically (0) /home/a/xxx/xxx.net/public_html/bitrix/modules/main/classes/general/module.php:480 #0: call_user_func_array(array, array) /home/a/xxx/xxx.net/public_html/bitrix/modules/main/classes/general/module.php:480 #1: ExecuteModuleEventEx(array) /home/a/xxx/xxx.net/public_html/bitrix/modules/main/include.php:456 #2: require_once(string) /home/a/xxx/xxx.net/public_html/bitrix/modules/main/include/prolog_before.php:14 #3: require_once(string) /home/a/xxx/xxx.net/public_html/bitrix/modules/main/include/prolog.php:10 #4: require_once(string) /home/a/xxx/xxx.net/public_html/bitrix/header.php:1 #5: require(string) /home/a/xxx/xxx.net/public_html/index.php:2 Понятно, что это что-то из этого: Artmix\Handlers\Main\OnPageStart::checkReCaptcha() Но нет ничего такого установленного(( Скрин прилагаю... |
|
|
|
|