Skip to content

XSD templateType pattern does not allow hyphens in template file paths #98

@nicoyomha

Description

@nicoyomha

Description

The templateType pattern in etc/hyva-grid.xsd (line 179) does not allow hyphens (-) in template file paths, even though hyphens are common in Magento template naming.

Pattern

<xs:pattern value="[A-Z][a-zA-Z0-9]*_[A-Z][a-zA-Z0-9]*::[a-zA-Z/.-_]+\.phtml"/>

The character class [a-zA-Z/.-_] is interpreted as:

  • a-z — lowercase range
  • A-Z — uppercase range
  • / — literal
  • .-_range from . (ASCII 46) to _ (ASCII 95)

The - between . and _ acts as a range operator, not a literal hyphen. Since - is ASCII 45 (one below . at 46), it falls outside the range and is not matched.

Error

Using a template like Vendor_Module::grid/fields/my-template.phtml causes:

Element 'column', attribute 'template': [facet 'pattern'] The value
'Vendor_Module::grid/fields/my-template.phtml' is not accepted by the pattern
'[A-Z][a-zA-Z0-9]*_[A-Z][a-zA-Z0-9]*::[a-zA-Z/.-_]+\.phtml'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions