Skip to content

[5.x] Fix issues with Blade nav tag compiler#11872

Merged
jasonvarga merged 1 commit into
statamic:5.xfrom
JohnathonKoster:bugfix/blade-nav-tag
Jun 19, 2025
Merged

[5.x] Fix issues with Blade nav tag compiler#11872
jasonvarga merged 1 commit into
statamic:5.xfrom
JohnathonKoster:bugfix/blade-nav-tag

Conversation

@JohnathonKoster

Copy link
Copy Markdown
Contributor

This PR fixes #11806.

Problem

The current implementation of the nav compiler will create a temporary file and include that behind the scenes, which worked in supporting recursive children. However, this causes issues when importing classes or functions, as this information would be lost inside the hidden temporary file.

Additionally, because the current implementation triggers a Blade compilating in creating that temporary file, it can mess with the internal raw block state, causing placeholder strings like @__raw_block_1__@ to appear in the output.

The Fix

This PR addresses both issues by refactoring away the temporary file, and instead inlines the compiled navigation code in a function. Recursive navigation support is maintained by simply calling that compiled function instead of including a hidden view.

@jasonvarga jasonvarga merged commit 3457747 into statamic:5.x Jun 19, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edge case when using blade view helpers within antler blade component default slot

2 participants