-
Bug
-
Resolution: Fixed
-
Minor
-
2.3, 2.3.1, 2.4
-
MOODLE_23_STABLE, MOODLE_24_STABLE
-
MOODLE_22_STABLE, MOODLE_23_STABLE
-
MDL-35034-master -
I configured the Google Docs repository but with some accounts i get the message "Invalid JSON string".
I think i found a problem in the file lib/googleapi.php (line 115), the code is...
$source = (string)$gdoc->content[0]->attributes()->src;,
|
...but in the XML entry for PDF documents there is no "content" or "src" attributes.
Debugging the xml file i found this
[title] => Test file.pdf
|
[link] => Array
|
(
|
[0] => SimpleXMLElement Object
|
(
|
[@attributes] => Array
|
(
|
[rel] => alternate
|
[type] => text/html
|
[href] => https://docs.google.com/file/test/test-test-test-test/edit
|
)
|
|
)
|
...
|
So the correct path to parse this XML entry is different than what appears on lib/googleapi.php (line 115). I changed it to this...
$source = (string)$gdoc->link[0]->attributes()->href;
|
...and now it works fine
Sorry if this issue is duplicated, i tried to find something similar without success.