Posted by solipsist on February 15, 2009 at 11:07am
| 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.
| Attachment | Size |
|---|---|
| views-view-json.tpl_.php_.patch | 863 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)
#3
Thanks for the patches; don't know how I missed that. Will be fixed in next releases.
#4
Fixed in alpha3: http://drupal.org/node/598242
#5
#6
Automatically closed -- issue fixed for 2 weeks with no activity.