#9326 closed defect (fixed)
path variable is set to null because of json_decode
Reported by: | Simon Speich | Owned by: | Jared Jurkiewicz |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | DojoX Data | Version: | 1.3.1 |
Keywords: | FileStore, php, demos, data | Cc: | |
Blocked By: | Blocking: |
Description
In the file filestore_dojotree.php and filestore_dojoxdata.php on line 55 the $path variable is not a json encoded string. Therefore the function json_decode() returns NULL and subdirectories are never displayed, because the line 58
if (!is_string($path)) {
is always false! Solution: Just omit the function call in line 55 and use
$path = $_GET['path']
and everything works as expected.
//See if a specific file was requested, or if it is just a query for files. $path = false; if (array_key_exists("path", $_GET)) { $path = $_GET['path']; // line below would return NULL // $path = json_decode($_GET['path']); } // line below always evaluates to false because json_decode sets the $path to NULL! if (!is_string($path)) {
Change History (4)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
So, the json_decode function works here. Though you are right, path isn't JSON encoded, so shouldn't need that call.
Note I tested on a basic PHP.net PHP install.
comment:3 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [17601]) Minor tweak to PHP files for FileStore?. fixes #9326
comment:4 Changed 12 years ago by
Milestone: | tbd → 1.4 |
---|
Note: See
TracTickets for help on using
tickets.
This is working fine for me on dojocampus: http://docs.dojocampus.org/dojox/data/FileStore
I see it making many calls with path set and it's loading data from the server fine.