Skip to content

Commit

Permalink
Fix nav breadcrumbs in Blade (#5599)
Browse files Browse the repository at this point in the history
Co-authored-by: StyleCI Bot <bot@styleci.io>
  • Loading branch information
jasonvarga and StyleCIBot committed Apr 11, 2022
1 parent c29d840 commit 5154c95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/Tags/FluentTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use ArrayIterator;
use Statamic\Support\Str;
use Statamic\View\Antlers\Parser;
use Traversable;

class FluentTag implements \IteratorAggregate, \ArrayAccess
Expand Down Expand Up @@ -105,7 +104,7 @@ public function fetch()
}

$tag = app(Loader::class)->load($name, [
'parser' => app(Parser::class),
'parser' => null,
'params' => $this->params,
'content' => '',
'context' => $this->context,
Expand Down
4 changes: 4 additions & 0 deletions src/Tags/Nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public function breadcrumbs()
return $crumb;
});

if (! $this->parser) {
return $crumbs;
}

$output = $this->parseLoop($crumbs->toAugmentedArray());

if ($backspaces = $this->params->int('backspace', 0)) {
Expand Down
3 changes: 1 addition & 2 deletions tests/Tags/FluentTagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Statamic\Tags\FluentTag;
use Statamic\Tags\Loader;
use Statamic\Tags\Tags;
use Statamic\View\Antlers\Parser;
use Tests\PreventSavingStacheItemsToDisk;
use Tests\TestCase;

Expand Down Expand Up @@ -47,7 +46,7 @@ public function it_handles_params_fluently($usedTag, $expectedTagName, $expected
->withArgs(function ($arg1, $arg2) use ($expectedTag, $expectedTagName, $expectedTagMethod) {
return $arg1 === $expectedTagName
&& is_array($arg2)
&& $arg2['parser'] instanceof Parser
&& is_null($arg2['parser'])
&& Arr::except($arg2, 'parser') === [
'params' => [
'sort' => 'slug:desc',
Expand Down

0 comments on commit 5154c95

Please sign in to comment.