Skip to content

Commit

Permalink
bugfix #137 Fix template attributes forbidden (, masonen)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
phansys committed Aug 19, 2019
2 parents f99295a + c742978 commit 03df9d4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
3 changes: 2 additions & 1 deletion Resources/views/Ticket/show_attachment.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% import 'HackzillaTicketBundle:Macros:macros.html.twig' as macros %}
{% import 'hackzilla_ticket.templates.macros' as macros %}

{% if message.attachmentName %}
<br>
<div class="ticket_attachment">
Expand Down
6 changes: 2 additions & 4 deletions TwigExtension/TicketFeatureExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
namespace Hackzilla\Bundle\TicketBundle\TwigExtension;

use Hackzilla\Bundle\TicketBundle\Component\TicketFeatures;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

class TicketFeatureExtension extends AbstractExtension
class TicketFeatureExtension extends \Twig_Extension
{
private $ticketFeatures;

Expand All @@ -21,7 +19,7 @@ public function __construct(TicketFeatures $ticketFeatures)
public function getFunctions()
{
return [
new TwigFunction('hasTicketFeature', [$this, 'hasFeature']),
new \Twig_SimpleFunction('hasTicketFeature', [$this, 'hasFeature']),
];
}

Expand Down
5 changes: 1 addition & 4 deletions TwigExtension/TicketGlobalExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

namespace Hackzilla\Bundle\TicketBundle\TwigExtension;

use Twig\Extension\AbstractExtension;
use Twig\Extension\GlobalsInterface;

class TicketGlobalExtension extends AbstractExtension implements GlobalsInterface
class TicketGlobalExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface
{
protected $templates = [];

Expand Down
11 changes: 2 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"php": "^5.6 || ^7.0",
"doctrine/doctrine-bundle": "^1.4",
"doctrine/orm": "^2.4.8",
"knplabs/knp-paginator-bundle": "^2.3 || ^3.0 || ^4.0",
"knplabs/knp-paginator-bundle": "^2.3 || ^3.0",
"symfony/config": "^2.8 || ^3.0 || ^4.0",
"symfony/console": "^2.8 || ^3.0 || ^4.0",
"symfony/dependency-injection": "^2.8 || ^3.0 || ^4.0",
Expand All @@ -41,8 +41,7 @@
"symfony/security-bundle": "^2.8 || ^3.0 || ^4.0",
"symfony/translation": "^2.8 || ^3.0 || ^4.0",
"symfony/validator": "^2.8 || ^3.0 || ^4.0",
"symfony/yaml": "^2.8 || ^3.0 || ^4.0",
"twig/twig": "^1.34 || ^2.0"
"symfony/yaml": "^2.8 || ^3.0 || ^4.0"
},
"require-dev": {
"ext-pdo_sqlite": "*",
Expand All @@ -60,12 +59,6 @@
"autoload": {
"psr-4": {
"Hackzilla\\Bundle\\TicketBundle\\": ""
},
"exclude-from-classmap": ["Tests/"]
},
"autoload-dev": {
"psr-4": {
"Hackzilla\\Bundle\\TicketBundle\\Tests\\": "Tests/"
}
},
"config": {
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="Tests/bootstrap.php"
>
<php>
Expand Down

0 comments on commit 03df9d4

Please sign in to comment.