The components/alert/alert.twig template contains a Twig syntax error that causes the error:

Twig\Error\SyntaxError: Unknown "endfor" tag in "bootstrap_barrio:alert" at line 79.

Steps to reproduce:
1. Use Bootstrap Barrio 5.5.x
2. Trigger a status message/alert
3. Observe Twig syntax error

Root cause:
In commit 7e4e4a8 (Issue #3485305), when removing the close button from the alert template, the closing

tag was also accidentally removed and replaced with a duplicate {% endfor %} tag.

The template has two {% for %} loops:
• Outer loop at line 32: {% for type, messages in message_list %}
• Inner loop at line 69: {% for message in messages %}

But there are three {% endfor %} tags:
• Line 76: closes inner loop (correct)
• Line 79: duplicate/extra (incorrect - should be < /div> (added a space to have this render in the description))
• Line 80: closes outer loop (correct)

Additionally, the

tag opened at line 55 is never closed.

Proposed fix:
Remove the duplicate {% endfor %} at line 79 and add the missing

closing tag at line 78 to close the div opened at line 55.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hussainweb created an issue. See original summary.

hussainweb’s picture

Issue summary: View changes
hussainweb’s picture

Issue summary: View changes
hussainweb’s picture

Issue summary: View changes

hussainweb’s picture

Status: Active » Needs review

  • hatuhay committed cb43aafb on 5.5.x
    Issue #3568160 by hussainweb: Syntax error in alert.twig: Missing...
hatuhay’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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