Refactoring broke twig template #79

Closed
Seldaek opened this Issue Apr 4, 2013 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

Seldaek commented Apr 4, 2013

The refactoring in 103a140 broke all paging we had on packagist.

The following twig code returned the proper number of pages before the commit, but after the commit it returns null even though calling the getNbPages() method by hand in the controller works fine. {{ pager.nbPages }} seems to be like twig can't detect properly which value to read for this method.

Contributor

Seldaek commented Apr 4, 2013

BTW {{ pager.getNbPages() }} works fine. I'm using latest twig (1.12.2).

Contributor

pablodip commented Apr 4, 2013

What do you think the problem is? We don't use anything from Twig in Pagerfanta.

Contributor

Seldaek commented Apr 4, 2013

I think it's just the accessor guesser in Twig_Template::getAttribute that goes nuts with this one, but I don't understand why. It worked before this commit and fails after. I guess it is a Twig bug triggered by some change you did, it's just hard to see given the size of the commit.

Contributor

Seldaek commented Apr 4, 2013

OK I found what it is actually. I'll send a PR in a minute.

@pablodip pablodip closed this in 9b76f1b Apr 4, 2013

pablodip added a commit that referenced this issue Apr 4, 2013

Merge pull request #80 from Seldaek/patch-1
Remove unused property, fixes #79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment