Skip to content

Commit 03df9d4

Browse files
committed
bugfix #137 Fix template attributes forbidden (, masonen)
This PR was squashed before being merged into the master branch (closes #137). Discussion ---------- This fixes #136 (and #106 ) The fix was pulled into development but never merged into master. Commits ------- c742978 - fix twigphp/Twig#2336, just need to import macros in all template
2 parents f99295a + c742978 commit 03df9d4

5 files changed

Lines changed: 8 additions & 18 deletions

File tree

Resources/views/Ticket/show_attachment.html.twig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{% import 'HackzillaTicketBundle:Macros:macros.html.twig' as macros %}
1+
{% import 'hackzilla_ticket.templates.macros' as macros %}
2+
23
{% if message.attachmentName %}
34
<br>
45
<div class="ticket_attachment">

TwigExtension/TicketFeatureExtension.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
namespace Hackzilla\Bundle\TicketBundle\TwigExtension;
44

55
use Hackzilla\Bundle\TicketBundle\Component\TicketFeatures;
6-
use Twig\Extension\AbstractExtension;
7-
use Twig\TwigFunction;
86

9-
class TicketFeatureExtension extends AbstractExtension
7+
class TicketFeatureExtension extends \Twig_Extension
108
{
119
private $ticketFeatures;
1210

@@ -21,7 +19,7 @@ public function __construct(TicketFeatures $ticketFeatures)
2119
public function getFunctions()
2220
{
2321
return [
24-
new TwigFunction('hasTicketFeature', [$this, 'hasFeature']),
22+
new \Twig_SimpleFunction('hasTicketFeature', [$this, 'hasFeature']),
2523
];
2624
}
2725

TwigExtension/TicketGlobalExtension.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
namespace Hackzilla\Bundle\TicketBundle\TwigExtension;
44

5-
use Twig\Extension\AbstractExtension;
6-
use Twig\Extension\GlobalsInterface;
7-
8-
class TicketGlobalExtension extends AbstractExtension implements GlobalsInterface
5+
class TicketGlobalExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface
96
{
107
protected $templates = [];
118

composer.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"php": "^5.6 || ^7.0",
2929
"doctrine/doctrine-bundle": "^1.4",
3030
"doctrine/orm": "^2.4.8",
31-
"knplabs/knp-paginator-bundle": "^2.3 || ^3.0 || ^4.0",
31+
"knplabs/knp-paginator-bundle": "^2.3 || ^3.0",
3232
"symfony/config": "^2.8 || ^3.0 || ^4.0",
3333
"symfony/console": "^2.8 || ^3.0 || ^4.0",
3434
"symfony/dependency-injection": "^2.8 || ^3.0 || ^4.0",
@@ -41,8 +41,7 @@
4141
"symfony/security-bundle": "^2.8 || ^3.0 || ^4.0",
4242
"symfony/translation": "^2.8 || ^3.0 || ^4.0",
4343
"symfony/validator": "^2.8 || ^3.0 || ^4.0",
44-
"symfony/yaml": "^2.8 || ^3.0 || ^4.0",
45-
"twig/twig": "^1.34 || ^2.0"
44+
"symfony/yaml": "^2.8 || ^3.0 || ^4.0"
4645
},
4746
"require-dev": {
4847
"ext-pdo_sqlite": "*",
@@ -60,12 +59,6 @@
6059
"autoload": {
6160
"psr-4": {
6261
"Hackzilla\\Bundle\\TicketBundle\\": ""
63-
},
64-
"exclude-from-classmap": ["Tests/"]
65-
},
66-
"autoload-dev": {
67-
"psr-4": {
68-
"Hackzilla\\Bundle\\TicketBundle\\Tests\\": "Tests/"
6962
}
7063
},
7164
"config": {

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11+
syntaxCheck="false"
1112
bootstrap="Tests/bootstrap.php"
1213
>
1314
<php>

0 commit comments

Comments
 (0)