-
Bug
-
Resolution: Fixed
-
Minor
-
2.2.4, 2.3.1, 2.4
-
MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
-
MOODLE_22_STABLE, MOODLE_23_STABLE
-
MDL-35101-master -
When adding a picture from Flickr Public, a JSON error will break the process if the picture don't have a license. Well, it actually has a license of 0, which is the license 'All rights reserved' by default at Flickr. And in our table, the license 0 does not exist.
More information about the possible licenses:
http://www.flickr.com/services/api/flickr.photos.licenses.getInfo.html
Replication steps
- Go to your Flickr account and add a file
- Set the debug level to DEBUG_DEVELOPER
- Enable the Flickr Public repository
- Add an instance using your email address linked with your Flickr account
- Go to your private files and click on 'Add'
- Navigate through the Flickr Public instance
- Select the newly uploaded picture and click 'Select file'
Actual:
- A wild JSON error appears
Expected:
- Everything is fine
—
The JSON error:
Invalid JSON string
|
|
Notice: Undefined index: 0 in /home/fred/www/repositories/stable_master/moodle/repository/flickr_public/lib.php on line 225
|
|
Call Stack:
|
0.0006 837776 1. {main}() /home/fred/www/repositories/stable_master/moodle/repository/repository_ajax.php:0
|
1.4430 35644696 2. repository_flickr_public->get_file() /home/fred/www/repositories/stable_master/moodle/repository/repository_ajax.php:290
|
5.1195 35759024 3. repository_flickr_public->license4moodle() /home/fred/www/repositories/stable_master/moodle/repository/flickr_public/lib.php:477
|
|
{"event":"fileexists","newfile":{"filepath":"\/","filename":"archive-48_2.jpg","url":"http:\/\/fred.moodle.local\/stable_master\/draftfile.php\/5\/user\/draft\/209152043\/archive-48_2.jpg"},"existingfile":{"filepath":"\/","filename":"archive-48.jpg","url":"http:\/\/fred.moodle.local\/stable_master\/draftfile.php\/5\/user\/draft\/209152043\/archive-48.jpg"}}
|
- blocks
-
MDL-34633 Flickr repository not working (changes in Flickr API?)
-
- Closed
-