Skip to content

Commit

Permalink
Exclude content highlighting on console request (#7000)
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed May 13, 2024
1 parent 3e1245e commit d216e22
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ class ContentHighlightAsset extends AssetBundle
*/
public static function register($view)
{
$highlight = Yii::$app->session->get('contentHighlight');
if ($highlight !== null && $highlight !== '') {
Yii::$app->session->remove('contentHighlight');
$view->registerJsConfig('content.highlight', ['keyword' => $highlight]);
if (!Yii::$app->request->isConsoleRequest) {
$highlight = Yii::$app->session->get('contentHighlight');
if ($highlight !== null && $highlight !== '') {
Yii::$app->session->remove('contentHighlight');
$view->registerJsConfig('content.highlight', ['keyword' => $highlight]);
}
}

return parent::register($view);
Expand Down

0 comments on commit d216e22

Please sign in to comment.