JSON is a text-based open standard. It is human-readable and used for data interchange between applications. Use this tag for questions related to topics such as 'JSON used in Drupal web services (REST)' or 'JavaScript callback functions which returns data in JSON format'.

learn more… | top users | synonyms

1
vote
1answer
16 views

Is json_decode parse-ability proof of a safe string?

Do I need to use check_plain (or something else) when displaying a user supplied JSON string, when I have previously checked it successfully parses with json_decode?
1
vote
0answers
53 views

Setting Up Drupal 8 REST Post Request

I am having issues sending a POST request to create a node with Drupal 8 Core REST. Here are the steps I have went through several times. Note that these steps are in effort to produce a working ...
1
vote
1answer
27 views

What's wrong with my GET request? (Commerce Services, REST)

I'm developing a mobile app to connect with my Drupal Commerce (Kickstart) store, using a REST server. When I do GET: endpoint/rest/product it retrieves the products list <result ...
1
vote
0answers
13 views

drupal 7 AJAX loaded node returns two different formats

hi I'm loading some node info via AJAX and in one instance it works fine, the other instance I get raw information back, I'm not sure if this raw info if JSON (as I'm not sure what JSON is), but what ...
1
vote
0answers
21 views

Ajax load node via jQuery

I'm having a bit of an issue with Ajax appearing inconsistent when loading my nodes. I initially followed the advice in this blog http://mrkadin.com/blog/node/70 which appears to work perfectly ...
1
vote
2answers
38 views

Using PHP arrays in Javascript Drupal 7 [duplicate]

I've been stuck on this all day and I haven't been able to find an answer that solved my issue: I need to make a PHP variable available in my Javascript file. Currently I'm using a fetchMarkers.php ...
1
vote
1answer
24 views

Responsive Views-Slideshow Json Cycle working good in Chrome not in IE or mozilla

In drupal I AT themes, views with slideshow of json2 and cycle plugin. I set the options for the plugin like this : Make views slideshow responsive - remove inline styles height auto , width auto ...
0
votes
1answer
10 views

Setting Tax Included on Commerce via JSON Service

I want to set the value of the tax included field (in database commerce_price_data) via Services (REST) talking JSON. I found modules helping doing this when adding the products manualy to set the ...
0
votes
0answers
25 views

Feed importer different node from each element

i am having some issues with feed importer. I am trying to create two different nodes from a JSON with feed importer. For example i have the following JSON and i need to create a "HOME" titled node ...
0
votes
1answer
67 views

How to return JSONP from a menu callback

I can create JSON output using a menu hook using the drupal_json_output callback. Example: $items['page/%/json'] = array( 'access callback' => TRUE, 'page callback' => ...
0
votes
1answer
60 views

Drupal fullcalendar integration -> JSON Formatting?

I am working on a custom fullcalendar (http://fullcalendar.io/) implemenation for a custom module of mine. I have created an hook_menu that will provide the json output that contains the events that ...
0
votes
0answers
16 views

why is my simple node Service returning views.exposed_data

my simple Services endpoint uses the View3 & JSON data document settings in this screenshot: at least a few days ago the structure was simply... {}{ "nodes": [{node:{},..], "view": { "name": ...
0
votes
0answers
60 views

Can Feeds Create Multiple Nodes/Node Titles from JSON Arrays?

In most cases, I know how to input multiple values into a single field with Feeds, no problem. Simple as a JSONPath Parser Setting for $.* Context and then the multivalue field ('Color' in this ...
0
votes
0answers
17 views

How do I know how many items are on a page for a json object

Im trying to make a view that contains JSON data for a list of articles in another view. I have all the data about every article but I also want to add the number of articles per page and the total ...
1
vote
3answers
154 views

Reducing Number of Fields in Content Type

Context: I have a product content type on Drupal 7 with >100 fields, and there are >7000 products, all with several revisions. Our client keeps requesting that we add and remove fields, which is ...
0
votes
0answers
29 views

Custom register form and default register form

I have a custom module that alters the default form. It's a multistep form, lot more other details, web service xml posting and getting details etc. The thing is here, now I'm using the Services+REST ...
0
votes
0answers
11 views

token does not work in upload directory of webform

i'm using service modules for generate json data , ve it's done in json data image data is inserted but i want to insert image url in json , how can i do this ? thanks for your helping
0
votes
0answers
33 views

I want to display feeds in JSON?

I am using aggregator feeds.I have to created feeds.xml file. But i have to create JSON file for Drupal 7? How to create it .Anyone guide to me.
0
votes
0answers
20 views

Json Populated Select Boxes 'An illegal choice has been detected' [duplicate]

I'm dynamically building the select options using json. When the user submits the form they get 'An illegal choice has been detected'. I know this is because I populated the options outside of ...
0
votes
1answer
77 views

RESTws POST List (text) field type Error

I'm using RESTws and POSTing a JSON object to "/node". Everything works fine until I include a List text field (checkbox type). The field in question is: ... "field_days_closed_v": ["Monday", ...
-1
votes
2answers
55 views

How to insert HTML that includes an ampersand>

I've created a custom block, and I'm trying to get this custom block to output a specific piece of HTML. The HTML needs to be different on every page, because it needs to include the page's URL in it. ...
0
votes
1answer
47 views

Dealing with compressed JSON string from external API

I'm trying to call the Stack Exchange API but it sends compressed JSON strings and I can't uncompress it. $request = ...
0
votes
1answer
56 views

Drupal Json Output strange characters when pulling from other language

Hi Fellow drupal experts, I have a problem, I developed a custom page intended to do a drupal json output : and here is the code : function blogpull_menu() { $items = array(); ...
2
votes
2answers
62 views

Using migrate with a multi-page / paginated source

I have a working module pulling a JSON feed into Drupal using the Migrate module. However, the feed is paginated, and I am only getting the first page of results (ordered DESC on creation, so giving ...
0
votes
3answers
156 views

custom block menu path returns json Ok, but a 404 status header

I created a custom path via hook_menu with a page callback to a function that prints json. It all works in the sense that requesting: http://cms.tripchi.com/tripchi/getme returns my JSON, but the ...
0
votes
1answer
235 views

Drupal Services 3 Post new node with Image Field and Entity Reference (returns status 200, nid:null)

I'm trying to create a new node using Drupal 7 + Services 3. The node type is 'activity_photo' has an image field, and a reference to a node. This is what I'm posting to the service { ...
0
votes
2answers
371 views

How to receive JSON data in controller with Drupal 8?

I'm using AngularJS one of my module's settings page, so I have a javascript object in client side as a model. Could anyone help me please, how to catch this data in a controller if I send it as JSON ...
0
votes
0answers
93 views

RESTful web services 500 or 406 Error when “£” is in a value

I'm using RESTful web services and Node.js to export a Mongo database into Drupal. This is working fine, however I get the occasional 500 or 406 error. I've narrowed it down to a "£" sign. In node I'm ...
0
votes
1answer
164 views

Multiple points openlayers geojson display only the last of it

I made a module retrieving data with geodata. The import feature allows to create a file in geojson. So, i'd like to display the points and the data without using Views, only openlayers module. I saw ...
2
votes
2answers
348 views

Drupal function to convert node into Json object

I would like to know if any drupal function is readily available which converts the node object into Json object so that i can return it in the menu callback function in Ajax call. thanks, Ahmad
0
votes
1answer
279 views

Converting JSON to select list options

I have an array that I have JSON decoded from a JSON object. Below is my array I am using for select options. The problem is each select options has a option group with a number (0-11). How can I ...
0
votes
0answers
79 views

drupal 7 views - access entire (!) views content after ajax refresh as json

im facing the following situation: i have a view with exposed filters. after the user has altered the view using the filters, i need to access the view's entire data as json. therefore its not enough ...
0
votes
1answer
189 views

Changing numbers of render-blocking JavaScript and CSS

I have a drupal 7 site. I use the Advanced CSS/JS Aggregation module In the past I asked this question, and tried to improve performance and "Eliminate render-blocking JavaScript and CSS in ...
2
votes
1answer
214 views

Drupal 7 - HTTP/AJAX/JSON responses at same URL with Accept Header (like D8)

Drupal 8 has this new amazing in-built functionality for handling requests from browsers and via AJAX at the same URL using the Accept header, which makes the CTools way of adding "nojs" to URLs, and ...
0
votes
1answer
222 views

Drush make unable to determine mime type for js

On every .js library that needs to be downloaded, I keep getting errors like: https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js. Unable to determine mime type for ...
2
votes
3answers
1k views

Drupal 7 - How do I parse JSON data from a website and import them as Nodes and have them update hourly?

I have drupal 7 with the Feeds and FeedsJSONParser module installed, but I can't seem to figure out how to configure this to parse the feeds. I want to parse the following feeds into their own nodes: ...
0
votes
1answer
26 views

Services 3.0 Json string reveived with underscores

I am using D7 services 3.0 and im sending data from an app. I use the json.stringify function before sending the data to my endpoint. However some characters are being replaced by underscores. For ...
2
votes
1answer
112 views

Drupal Services node filtering based on taxonomy terms

I followed this post, I am able to filter nodes based on content type and other parameters http://test/api/node?parameters[nid]=1&parameters[status]=1 but I am not able to filter based on ...
0
votes
1answer
57 views

Why page call back is not needed in Ajax jQuery Drupal 6?

function example_menu() { $items['example-menu'] = array( 'page callback' => 'get-result', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ...
0
votes
1answer
336 views

How to Post JSON data to Cart service in Drupal Commerce Services

I'm uses Drupal commerce services for mobile commerce. But I don't know how to Post jSON to REST service Cart or Order. With Comment services I"m post JSON successful as below: URL: ...
1
vote
1answer
209 views

Get JSON geolocation data into Google Maps Module [closed]

I have some JSON data with lat/lon values. I'm trying to plot these points on a google maps module. Which google maps module should I use and what is the easiest way to go about this? Thanks
1
vote
2answers
161 views

drupal_json_output() output ascii

I have a module that populate commerce cart product titles. The function looks like this: function spcart_get(){ global $user; $order = commerce_cart_order_load($user->uid); $wrapper = ...
0
votes
0answers
111 views

Creating JSON-RPC PHP client/server setup: permissions question

I am currently creating two modules in two sites, a client and a server on each site respectively. I want the client to be able to be called from code in any module that needs to communicate with the ...
0
votes
1answer
132 views

Migrate : Update not working

Im using the migrate module to import data from a json feed. Mostly work fine however, i require that each time the feed is imported , updated records in the source are updated in the destination if ...
0
votes
1answer
100 views

Ordering results for D7 form autocomplete fields

I've done the cursory Googling but so far haven't found anything close to an answer for this. I'm using the Masquerade module with a custom module on top to extend it and make its searching ...
1
vote
1answer
159 views

How to render a nodequeue queue as custom JSON (Drupal 6.x)?

What would be the most sensible way to render a nodequeue queue in a custom JSON format (using Drupal 6) We have a nodequeue that is both included in the UI in various places and served in a RSS ...
7
votes
1answer
1k views

How to create user with role(s) through REST service?

I could able to create a new user by the following JSON format.(Using POSTER add-on to post this data to REST service.) { "name":"user34", "pass":"3323", "mail":"sample@example.com", ...
1
vote
2answers
2k views

Register User with Services (JSON) with Custom Fields

I am trying to register a new user on Drupal7 via services with JSON. Actually I am posting info from JAVA (android) with JSON format to the server with services module enabled. A sample successful ...
1
vote
1answer
388 views

How to implement date filters with operators like <= or >= in a JSON query string?

We use Drupal 7 and the Service (Version 3) module. First we created a view using a date with a "between operator" as a filter, which works fine. Then we added a service view as .json format inn which ...
0
votes
2answers
108 views

Feeding JSON into a Content Type and allow for updates

So I have a JSON feed coming from a provider that I'd like to turn into a node type for D7. Within this feed we have a lot of common things like Bios, Names, Pictures, stats, etc. This feed can ...