Project:Views Datasource
Version:6.x-1.0-alpha2
Component:Code
Category:bug report
Priority:normal
Assigned:allisterbeharry
Status:closed (fixed)

Issue Summary

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

Comments

#1

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

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

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

#4

Status:active» fixed

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

#5

Assigned to:Anonymous» allisterbeharry

#6

Status:fixed» closed (fixed)

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