diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index aff143f519487..d25e46486c299 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -2029,7 +2029,6 @@ public function process_badge($data) { $params = array( 'name' => $data->name, 'description' => $data->description, - 'image' => 0, 'timecreated' => $this->apply_date_offset($data->timecreated), 'timemodified' => $this->apply_date_offset($data->timemodified), 'usercreated' => $data->usercreated, diff --git a/badges/newbadge.php b/badges/newbadge.php index 413e56c13690e..91c316c158d02 100644 --- a/badges/newbadge.php +++ b/badges/newbadge.php @@ -80,7 +80,6 @@ $fordb->timemodified = $now; $fordb->usercreated = $USER->id; $fordb->usermodified = $USER->id; - $fordb->image = 0; $fordb->issuername = $data->issuername; $fordb->issuerurl = $data->issuerurl; $fordb->issuercontact = $data->issuercontact; diff --git a/badges/tests/badgeslib_test.php b/badges/tests/badgeslib_test.php index 37c67075e3e10..b51d155e6afd2 100644 --- a/badges/tests/badgeslib_test.php +++ b/badges/tests/badgeslib_test.php @@ -46,7 +46,6 @@ protected function setUp() { $fordb->timemodified = time(); $fordb->usercreated = $user->id; $fordb->usermodified = $user->id; - $fordb->image = 0; $fordb->issuername = "Test issuer"; $fordb->issuerurl = "http://issuer-url.domain.co.nz"; $fordb->expiredate = null; @@ -74,7 +73,6 @@ public function test_clone_badge() { $newid = $badge->make_clone(); $cloned_badge = new badge($newid); - $this->assertEquals($badge->image, $cloned_badge->image); $this->assertEquals($badge->description, $cloned_badge->description); $this->assertEquals($badge->issuercontact, $cloned_badge->issuercontact); $this->assertEquals($badge->issuername, $cloned_badge->issuername); diff --git a/lib/badgeslib.php b/lib/badgeslib.php index daf2d44f0ce80..96d736d7fdaee 100644 --- a/lib/badgeslib.php +++ b/lib/badgeslib.php @@ -108,7 +108,6 @@ class badge { public $timemodified; public $usercreated; public $usermodified; - public $image; public $issuername; public $issuerurl; public $issuercontact; @@ -241,7 +240,6 @@ public function make_clone() { $fordb->name = get_string('copyof', 'badges', $this->name); $fordb->status = BADGE_STATUS_INACTIVE; - $fordb->image = 0; $fordb->usercreated = $USER->id; $fordb->usermodified = $USER->id; $fordb->timecreated = time(); @@ -1081,10 +1079,7 @@ function badges_process_badge_image(badge $badge, $iconfile) { require_once($CFG->libdir. '/gdlib.php'); if (!empty($CFG->gdversion)) { - if ($fileid = (int)process_new_icon($badge->get_context(), 'badges', 'badgeimage', $badge->id, $iconfile)) { - $badge->image = $fileid; - $badge->save(); - } + process_new_icon($badge->get_context(), 'badges', 'badgeimage', $badge->id, $iconfile); @unlink($iconfile); // Clean up file draft area after badge image has been saved. diff --git a/lib/db/install.xml b/lib/db/install.xml index 67660b3b23775..f7c7c424ff609 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -2868,7 +2868,6 @@ - diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index c6bafe0f1af13..99611099a6d24 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2190,5 +2190,18 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2013061700.00); } + if ($oldversion < 2013070400.01) { + // Define field attachment to be dropped from badge. + $table = new xmldb_table('badge'); + $field = new xmldb_field('image'); + + // Conditionally launch drop field eventtype. + if ($dbman->field_exists($table, $field)) { + $dbman->drop_field($table, $field); + } + + upgrade_main_savepoint(true, 2013070400.01); + } + return true; } diff --git a/version.php b/version.php index 37e7bc3401f0a..0590e1533dfb3 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2013070400.00; // YYYYMMDD = weekly release date of this DEV branch +$version = 2013070400.01; // YYYYMMDD = weekly release date of this DEV branch // RR = release increments - 00 in DEV branches // .XX = incremental changes