Skip to content

Unclosed cfif tag error in AdminViewService #2005

@zainforbjs

Description

@zainforbjs

Describe the bug
The CLI module fails to load due to a cfif tag parsing issue in AdminViewService. Error: tag [cfif] is not closed

This prevents the entire CLI module from loading.

To Reproduce

  1. Install Wheels CLI: box install wheels-cli or simply link latest CLI from develop branch to commandBox
  2. Run box reload or start CommandBox
  3. Observe the error during module loading

Expected behavior
The CLI module should load successfully without errors.

Desktop:

  • OS: macOS
  • Wheels Branch: Develop

Additional context
File: cli/src/models/AdminViewService.cfc:182

Problematic Code:

return "<cfif |ObjectNamePlural|." & field.name
    & '><span class="badge bg-success">Yes</span>'
    & '<cfelse><span class="badge bg-secondary">No</span></cfif>';

Root Cause: The <cfif> tag contains embedded CFML tag syntax within a string being built with concatenation. Adobe CF parser sees <cfif as an actual tag rather than part of a string literal, causing it to report that the tag is not closed.

Suggested Fix: Use chr(60) to escape the < character:

return chr(60) & "cfif |ObjectNamePlural|." & field.name
    & '><span class="badge bg-success">Yes</span>'
    & chr(60) & "cfelse><span class="badge bg-secondary">No</span>" & chr(60) & "/cfif>";

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase:1-stabilizeBugs, cleanup, CI fixes — tackle first

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions