Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-14862

Twig DEFINE error when set to another variable

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.2.0-RC1
    • Fix Version/s: None
    • Component/s: Template Engine
    • Labels:
    • Environment:
      PHP 5.6.26, MySQL 5.7.9, Firefox 49.0.2

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            BrokenCrust BrokenCrust (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: