Invalid JSON

solipsist - February 15, 2009 - 11:07
Project:Views Datasource
Version:6.x-1.0-alpha2
Component:Code
Category:bug report
Priority:normal
Assigned:allisterbeharry
Status:closed
Description

A JSON object is delineated by { and }. Currently (alpha 2), Views JSON doesn't wrap the JSON object in curly brackets. It's a simple fix and I've attached a patch that does it.

Further, hard-coding "nodes" as the name of the JSON object is a bit inappropriate as Views 2 supports comments, files, node revisions, terms and users. IMHO the object name should reflect the type of view that generated it.

I also noticed that the module doesn't follow the Drupal coding standards very strictly. It's a minor issue and understandable given it's an alpha.

AttachmentSize
views-view-json.tpl_.php_.patch863 bytes

#1

pereljon - March 3, 2009 - 21:00

Any fix for the drupal 5 version?
Is this module still maintained or is there another active module for exporting data through a view??

thanks!

#2

pereljon - March 3, 2009 - 21:39

Ok... here's my first ever attempt at a Drupal code patch (first ever code submit to Drupal... yey!)...
It fixes several issues with the delineation of the main JSON object (which was missing the curly braces).
It also fixes trailing commas in the last field of a node and in the last node of the JSON object.
Hope it works...
(Patch is for 5.x-1.0-alpha2)

AttachmentSize
views_json.module.patch 1.62 KB

#3

allisterbeharry - April 18, 2009 - 00:23

Thanks for the patches; don't know how I missed that. Will be fixed in next releases.

#4

allisterbeharry - October 8, 2009 - 13:43
Status:active» fixed

Fixed in alpha3: http://drupal.org/node/598242

#5

allisterbeharry - October 10, 2009 - 16:55
Assigned to:Anonymous» allisterbeharry

#6

System Message - October 24, 2009 - 17:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.