Good evening,
I recently upgraded to symfony 2.7.6. Beside it helped me to setup the HWIOAuthBundle, i noticed a bug in a template that was doing well before.
The following test is never valid, although I'm connected as the creator of this event!
{% if event.getCreator() == app.user %}
Creator looks like this :
class Event implements EventInterface
{
/**
* @ORM\ManyToOne(targetEntity="FS\UserBundle\Entity\User", cascade={"persist"}, fetch="EAGER")
*
* @ORM\JoinColumn(referencedColumnName="id", nullable=false, onDelete="CASCADE")
*/
private $creator;
public function getCreator()
{
return $this->creator;
}
...
I started searching in the profiler and discovered the Twig_ExtensionInterface::getGlobals() and Twig_ExtensionInterface::initRuntime() are deprecated in Symfony 2.7.6 (in my application).
Then i read a post from Twig developper Remi Collet, saying that these 2 deprecated calls can make Twig test fail, and uploaded a simple patch for twig (v1.23), but this patch didn't help.
I took an older version of twig/twig, which helped me solve the deprecated method warning. But the app.user test is still broken...
Anybody has an idea why my global extension, app.user can't be compared with another user in twig ?