Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for array to string conversion Twig exception #91

Merged
merged 2 commits into from
Feb 21, 2014

Conversation

epicwhale
Copy link
Contributor

This fixes the problem discussed in #83 where a Twig runtime exception is thrown when one of the job arguments is an array (which is always the case with jobs which support a retry strategy).

More here: #83

This fixes the problem discussed in michelsalib#83 where a Twig runtime exception is thrown when one of the job arguments is an array (which is always the case with jobs which support a retry strategy). 

More here: michelsalib#83
@epicwhale
Copy link
Contributor Author

I realized that the draw back of this solution is that in production mode, the dump(...) function is disabled in symfony2. So this won't work in production.

Anyone has an alternative?

Worst case, we make a child template through which we recursively loop argvalue.

@michelsalib
Copy link
Owner

Why not doing a json_encode ? With the associated twig filter ?

@epicwhale
Copy link
Contributor Author

@michelsalib ha, sounds good. Converted into

<em class="pull-right">{{ argvalue | json_encode(constant('JSON_PRETTY_PRINT')) }}</em>

Commited it in my PR. This looks better!

@michelsalib
Copy link
Owner

Great! Thanks!

michelsalib pushed a commit that referenced this pull request Feb 21, 2014
Fix for array to string conversion Twig exception
@michelsalib michelsalib merged commit 48a4a14 into michelsalib:master Feb 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants