A
A
Alexander Nameless082018-04-05 10:21:59
1C-Bitrix
Alexander Nameless08, 2018-04-05 10:21:59

What is the Bitrix error?

Hello!
What could be the errors. While I'm in the admin panel, everything is OK, as soon as I get out there are such problems - prntscr.com/j13ysz ? It was advised to check the line in the header: yes it was not there, for its place were:
<? $APPLICATION->ShowHead(); ?>

<? $APPLICATION->ShowHeadStrings(); ?> 
<? $APPLICATION->ShowHeadScripts(); ?>
replaced - prntscr.com/j13zkb , but the result is still unsatisfactory: prntscr.com/j141bz
Who knows what it could be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita, 2018-04-05
@Nameless08

Try to add in the header: CJSCore::Init ();
If it doesn't help, then write in init

AddEventHandler("main", "OnEndBufferContent", "deleteKernelJs");

function deleteKernelJs(&$content) {
   global $USER, $APPLICATION;
   if((is_object($USER) && $USER->IsAuthorized()) || strpos($APPLICATION->GetCurDir(), "/bitrix/")!==false) return;
   if($APPLICATION->GetProperty("save_kernel") == "Y") return;

   $arPatternsToRemove = Array(
      '/<sc ript.+?src=".+?kernel_main\/kernel_main\.js\?\d+"><\/sc ript\>/',
      '/<sc ript.+?src=".+?bitrix\/js\/main\/core\/core[^"]+"><\/sc ript\>/',
      '/<sc ript.+?>BX\.(setCSSList|setJSList)\(\[.+?\]\).*?<\/sc ript>/',
      '/<sc ript.+?>if\(\!window\.BX\)window\.BX.+?<\/sc ript>/',
      '/<sc ript[^>]+?>\(window\.BX\|\|top\.BX\)\.message[^<]+<\/sc ript>/',
   );

   $content = preg_replace($arPatternsToRemove, "", $content);
   $content = preg_replace("/\n{2,}/", "\n\n", $content);
}

This is an old bug, was in one of the versions. You can just update Bitrix :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question