Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-14862

Twig DEFINE error when set to another variable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.2.0-RC1
    • Template Engine
    • PHP 5.6.26, MySQL 5.7.9, Firefox 49.0.2

      Line 44 of phpbb\template\twig\defineparser.php

      throw new \Twig_Error_Syntax('Invalid DEFINE', $token->getLine(), $this->parser->getFilename());

      incorrectly throws an error when you use define to set a variable to the value of another e.g.

      <!-- DEFINE $RANKS_TITLE = RANK_TITLE -->

      gives

      Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'Invalid DEFINE in "template.html" at line xx' in phpbb\template\twig\tokenparser\defineparser.php:44

      however these all work fine

      <!-- DEFINE $RANKS_TITLE = something.RANK_TITLE -->
      <!-- DEFINE $RANKS_TITLE = (RANK_TITLE or RANK_NAME) -->

      Commenting out this line works around the issue so I think it should be expected to work this way.

            Unassigned Unassigned
            BrokenCrust BrokenCrust [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: