TypeError

preg_match_all(): Argument #2 ($subject) must be of type string, array given

when rendering smarty template themes/niara-b2b/./breadcrumb.tpl
compiled file cache/smarty/compile/41/d1/a2/41d1a2b64abc2d5c6cbfe9bb0a4b8abd8bb11a5e_0.file.breadcrumb.tpl.php at line 31

Source file: themes/niara-b2b/./breadcrumb.tpl

1:{if isset($smarty.capture.path)}{assign var='path' value=$smarty.capture.path}{/if}
2:
3:{if isset($path) && !empty($path)}
4:  {* Extract bradcrumb links from anchors *}
5:  {$matches = []}
6:  {$matchCount = preg_match_all('/<a.+?href="(.+?)"[^>]*>([^<]*)<\/a>/', $path, $matches)}
7:  {$breadcrumbs = []}
8:  {for $i=0; $i<$matchCount; $i++}
9:    {$breadcrumbs[] = ['url' => $matches[1][$i], 'title' => $matches[2][$i]]}
10:  {/for}
11:
12:  {* Extract the last breadcrumb which is not link, it's plain text or text inside span *}
13:  {$match = preg_match('/>([^<]+)(?:<\/\w+>\s*)?$/', $path, $matches)}
14:  {if !empty($matches[1])}
15:    {$breadcrumbs[] = ['url' => '', 'title' => $matches[1]]}
16:  {elseif !$match && !$matchCount}
17:    {$breadcrumbs[] = ['url' => '', 'title' => $path]}
18:  {/if}
19:{/if}
20:
21:<ol class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">
22:  <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
23:    <a href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}" title="{l s='Home Page'}" itemprop="item">
24:      <span itemprop="name">{l s='Home'}</span>
25:    </a>
26:    <meta itemprop="position" content="1">
27:  </li>
28:  {if !empty($breadcrumbs)}
29:    {foreach from=$breadcrumbs item=breadcrumb name=crumbs}
30:      <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
31:        {if isset($breadcrumb.url)}
32:          <a href="{$breadcrumb.url}" itemprop="item">
33:            <span itemprop="name">{$breadcrumb.title}</span>
34:          </a>
35:        {else}
36:          <a href="#" title="{$breadcrumb.title}" itemprop="item">
37:            <span itemprop="name">{$breadcrumb.title}</span>
38:          </a>
39:        {/if}
40:        <meta itemprop="position" content="{($smarty.foreach.crumbs.iteration|intval + 1)}">
41:      </li>
42:    {/foreach}
43:  {/if}
44:</ol>
45:
46:{if isset($smarty.get.search_query) && isset($smarty.get.results) && $smarty.get.results > 1 && isset($smarty.server.HTTP_REFERER)}
47:  <nav>
48:    <ul class="pager">
49:      <li class="previous">
50:        {capture}{if isset($smarty.get.HTTP_REFERER) && $smarty.get.HTTP_REFERER}{$smarty.get.HTTP_REFERER}{elseif isset($smarty.server.HTTP_REFERER) && $smarty.server.HTTP_REFERER}{$smarty.server.HTTP_REFERER}{/if}{/capture}
51:        <a href="{$smarty.capture.default|escape:'html':'UTF-8'|secureReferrer|regex_replace:'/[\?|&]content_only=1/':''}" name="back">
52:          <span>
53:            {if $isRtl}<i class="icon icon-angle-right"></i>{else}<i class="icon icon-angle-left"></i>{/if} {l s='Back to Search results for "%s" (%d other results)' sprintf=[$smarty.get.search_query,$smarty.get.results]}
54:          </span>
55:        </a>
56:      </li>
57:    </ul>
58:  </nav>
59:{/if}

Compiled file: cache/smarty/compile/41/d1/a2/41d1a2b64abc2d5c6cbfe9bb0a4b8abd8bb11a5e_0.file.breadcrumb.tpl.php

12:    '41d1a2b64abc2d5c6cbfe9bb0a4b8abd8bb11a5e' => 
13:    array (
14:      0 => '/var/www/grupobelle/themes/niara-b2b/breadcrumb.tpl',
15:      1 => 1683376385,
16:      2 => 'file',
17:    ),
18:  ),
19:  'includes' => 
20:  array (
21:  ),
22:),false)) {
23:function content_66042245a17637_66050131 (Smarty_Internal_Template $_smarty_tpl) {
24:$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/var/www/grupobelle/vendor/smarty/smarty/libs/plugins/modifier.regex_replace.php','function'=>'smarty_modifier_regex_replace',),));
25:if ((($_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'path') !== null ))) {
26:$_smarty_tpl->_assignInScope('path', $_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'path'));
27:}?>
28:
29:<?php if ((isset($_smarty_tpl->tpl_vars['path']->value)) && !empty($_smarty_tpl->tpl_vars['path']->value)) {?>
30:    <?php $_smarty_tpl->_assignInScope('matches', array());?>
31:  <?php $_smarty_tpl->_assignInScope('matchCount', preg_match_all('/<a.+?href="(.+?)"[^>]*>([^<]*)<\/a>/',$_smarty_tpl->tpl_vars['path']->value,$_smarty_tpl->tpl_vars['matches']->value));?>
32:  <?php $_smarty_tpl->_assignInScope('breadcrumbs', array());?>
33:  <?php
34:$_smarty_tpl->tpl_vars['i'] = new Smarty_Variable(null, $_smarty_tpl->isRenderingCache);
35:$_smarty_tpl->tpl_vars['i']->value = 0;
36:if ($_smarty_tpl->tpl_vars['i']->value < $_smarty_tpl->tpl_vars['matchCount']->value) {
37:for ($_foo=true;$_smarty_tpl->tpl_vars['i']->value < $_smarty_tpl->tpl_vars['matchCount']->value; $_smarty_tpl->tpl_vars['i']->value++) {
38:?>
39:    <?php $_tmp_array = isset($_smarty_tpl->tpl_vars['breadcrumbs']) ? $_smarty_tpl->tpl_vars['breadcrumbs']->value : array();
40:if (!(is_array($_tmp_array) || $_tmp_array instanceof ArrayAccess)) {
41:settype($_tmp_array, 'array');

Stack trace