Closed (fixed)
Project:
Views Datasource
Version:
6.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Jul 2012 at 09:46 UTC
Updated:
23 Sep 2013 at 16:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
pasqualleComment #2
alanburke commentedStill an issue on the Drupal 7 version.
Fix still works - line 28.
Thanks!
Comment #3
guile2912 commentedHaving a dynamic way to set the callback name in jsonp is a must have ! here is the patch of this feature
Comment #4
yannickooThis is really a must have otherwise you cannot make a JSONP AJAX request!
Patch still works and looks fine, so RTBC!
Comment #5
yannickooMarked #2010558: Option to add JSONP Prefix according to the callback query string parameter as duplicate.
Comment #6
yannickooSorry but there is a problem if no $_GET parameter was set (e.g. fetching the JSON via PHP) so I re-created the patch.
Comment #7
chrism2671 commentedCan somebody explain how this is supposed to work with AngularJS? What do I need to send as the 'jsonp_prefix' parameter from $http? Thanks!
Comment #8
chrism2671 commentedHi yannickoo,
I'm not sure your patch is correct.
In my opinion:
1) You use $_GET[$jsonp_prefix] which I think should be $_GET['jsonp_prefix']
2) You should be using || instead of &&.
Comment #9
yannickooHey Chris, that's correct because we have to check whether the $json_prefix is available in the $_GET array. The key is not 'json_prefix' it is $json_prefix. It is dynamic so that you can set it in the Views UI.
Comment #10
chrism2671 commentedAh got it! Thanks for pointing that out!
Comment #11
yannickooBut I would switch them, first the isset and then checking for a value...
Comment #12
yannickooComment #13
yannickooFixed with 6e9b6b9.
Comment #14
yannickooComment #15
yannickooFixed with 5c0c7aa.
Comment #16
yannickoo