Permalink
Browse files

MDL-26677 fixed undefined index usewatermarks in flickr plugin

  • Loading branch information...
1 parent c3f85e2 commit d55846d8bdf7fbb56711a1beae9c7965b199e208 @dcai dcai committed May 2, 2011
Showing with 8 additions and 3 deletions.
  1. +6 −1 admin/repositoryinstance.php
  2. +2 −2 repository/flickr_public/lib.php
View
7 admin/repositoryinstance.php
@@ -66,9 +66,14 @@
if ($edit) {
$settings = array();
$settings['name'] = $fromform->name;
+ var_dump($fromform);
if (!$instance->readonly) {
foreach($configs as $config) {
- $settings[$config] = $fromform->$config;
+ if (isset($fromform->$config)) {
+ $settings[$config] = $fromform->$config;
+ } else {
+ $settings[$config] = null;
+ }
}
}
$success = $instance->set_option($settings);
View
4 repository/flickr_public/lib.php
@@ -456,7 +456,7 @@ public function get_file($photo_id, $file = '') {
public function instance_config_form($mform) {
$mform->addElement('text', 'email_address', get_string('emailaddress', 'repository_flickr_public'));
$mform->addElement('checkbox', 'usewatermarks', get_string('watermark', 'repository_flickr_public'));
- //$mform->addRule('email_address', get_string('required'), 'required', null, 'client');
+ $mform->setDefault('usewatermarks', 0);
}
/**
@@ -498,7 +498,7 @@ public static function get_type_option_names() {
public static function plugin_init() {
//here we create a default instance for this type
- $id = repository::static_function('flickr_public','create', 'flickr_public', 0, get_system_context(), array('name'=>'', 'email_address' => null), 0);
+ $id = repository::static_function('flickr_public','create', 'flickr_public', 0, get_system_context(), array('name'=>'', 'email_address' => null, 'usewatermarks' => false), 0);
if (empty($id)) {
return false;
} else {

0 comments on commit d55846d

Please sign in to comment.