-
Notifications
You must be signed in to change notification settings - Fork 86
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
Error in javascript code? #16
Comments
The original code is working in our projects. Your suggested code would result in a busted string with extra backticks: 'viewUrl': '/uploads/tmp/attachments/'555555'' Because you are using the json_encode filter inside something that is already a quoted string. Are you getting a javascript error with the original code? Can I see that? |
Yes you are right the editId seems to be quoted. 'viewUrl': /uploads/tmp/attachments/"853341266", my variables was send, by this way : return array( So I tried to convert $editId into numerical type, I changed But now I get the following result : error is now "Uncaught SyntaxError: Invalid flags supplied to RegExp constructor 'tmp' " editId is generated by the way you said. I don't understand what is wrong. |
Replace this |
That will result in a JSON-encode, quoted string inside another set of If there is a bug here (and I am not convinced there is, because my uploads On Fri, Jan 11, 2013 at 7:37 PM, Egor notifications@github.com wrote:
Tom Boutell |
This was my solution: 'viewUrl': {{ '/uploads/tmp/attachments/#{editId}' | json_encode | raw }}, |
I have a very similiar issue. Using your code snippets I get: $(function() { |
Hello,
It's seems to be a mistake in the javascript code in edit template
$(function() {
new PunkAveFileUploader({
'uploadUrl': {{ path('upload', { editId: editId }) | json_encode | raw }},
'viewUrl': {{ '/uploads/tmp/attachments/' ~ editId | json_encode | raw }},
'el': '.file-uploader',
'existingFiles': {{ existingFiles | json_encode | raw }},
'delaySubmitWhileUploading': '.edit-form'
});
});
the lign : 'viewUrl': {{ '/uploads/tmp/attachments/' ~ editId | json_encode | raw }}, doesn't work on my project.
I had to replace it by 'viewUrl': '/uploads/tmp/attachments/{{ editId | json_encode | raw }}',
I'm using :
jquery-1.8.3.js
query-ui-1.9.2
Symfony 2.1.7
The text was updated successfully, but these errors were encountered: