"MDL-15488, fixed flickr plugin"
authorDongsheng Cai <unoter@gmail.com>
Wed, 10 Mar 2010 03:37:31 +0000 (03:37 +0000)
committerDongsheng Cai <unoter@gmail.com>
Wed, 10 Mar 2010 03:37:31 +0000 (03:37 +0000)
repository/flickr/repository.class.php

index cc083ae..2dc1fa2 100755 (executable)
@@ -301,7 +301,8 @@ class repository_flickr extends repository {
             $callbackurl = get_string('callbackwarning', 'repository_flickr');
             $mform->addElement('static', null, '',  $callbackurl);
         } else {
-            $callbackurl = $CFG->wwwroot.'/repository/repository_ajax.php?callback=yes&amp;repo_id='.$instances[0]->id;
+            $instance = array_shift($instances);
+            $callbackurl = $CFG->wwwroot.'/repository/repository_ajax.php?callback=yes&amp;repo_id='.$instance->id;
             $mform->addElement('static', 'callbackurl', '', get_string('callbackurltext', 'repository_flickr', $callbackurl));
         }