0

I get an error after updating twig

- Updating twig/twig (v2.6.0 => v2.6.1): 

In composer, I have:

"symfony/twig-bundle": "^4.1",

Error is:

twig/twig "Notice: Undefined index: vars"

In template:

{{ form.vars.id }}

If I put {{ dump(form) }}, I see +vars ...

Pinke Helga
  • 6,378
  • 2
  • 22
  • 42
Developer
  • 2,731
  • 2
  • 41
  • 71
  • Did you check this post? https://github.com/symfony/symfony/issues/5064#issuecomment-7285061 – jasie Jan 14 '19 at 10:12
  • Try turning off the php_twig extention. – jasie Jan 14 '19 at 10:16
  • 2
    Note: This is Not a duplicate of https://stackoverflow.com/q/4261133/6216 - it was a bug in the twig library. The linked question is not the problem, nor any solution. – Alister Bulman Jan 14 '19 at 16:17

1 Answers1

2

It's a (known) bug in twig v2.6.1 - https://github.com/twigphp/Twig/issues/2810

You can simply not update to that version for now, or explicitly mark it not to install until the next version has been released (it should be in the next day or two at most).

# Adding this line to composer.json will ensure that the version will not be installed.
"conflict": {
    "twig/twig": "2.6.1"
},

twig/twig v2.6.2 was released later the same day correcting the bug.

Alister Bulman
  • 34,482
  • 9
  • 71
  • 110