When using bootstrap theme PHP is giving next warning

Warning: Invalid argument supplied for foreach() in twig_drupal_join_filter() (line 293 of .../core/themes/engines/twig/twig.engine).

The problem is in html.html.twig:

<title>{{ head_title|safe_join(' | ') }}</title>

head_title is a string and not an array any more because of a next code in core template_preprocess_html():

$variables['head_title_array'] = $head_title;
$output = '';
$separator = '';
foreach ($head_title as $item) {
  $output .= $separator . SafeMarkup::escape($item);
  $separator = ' | ';
}
$variables['head_title'] = SafeMarkup::set($output);

So now bootstrap html.html.twig should either use

<title>{{ head_title_array|safe_join(' | ') }}</title>

or

<title>{{ head_title }}</title>

Comments

pivica’s picture

Status: Active » Needs review
StatusFileSize
new485 bytes

Here is a simple patch that just display head_title in the same way as other themes are doing it.

berdir’s picture

Status: Needs review » Reviewed & tested by the community
berdir’s picture

Status: Reviewed & tested by the community » Fixed

Was fixed elsewhere.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.