Merge branch 'MDL-45041_27_STABLE' of git://github.com/jleyva/moodle into MOODLE_27_STABLE

This commit is contained in:
Sam Hemelryk
2014-07-29 15:47:22 +12:00
4 changed files with 11 additions and 12 deletions
-1
View File
@@ -2959,7 +2959,6 @@
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="pushid-userid" TYPE="unique" FIELDS="pushid, userid"/>
<KEY NAME="pushid-platform" TYPE="unique" FIELDS="pushid, platform"/>
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
</KEYS>
</TABLE>
+10
View File
@@ -3669,5 +3669,15 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2014051200.06);
}
if ($oldversion < 2014051201.03) {
$table = new xmldb_table('user_devices');
$oldindex = new xmldb_index('pushid-platform', XMLDB_KEY_UNIQUE, array('pushid', 'platform'));
if ($dbman->index_exists($table, $oldindex)) {
$key = new xmldb_key('pushid-platform', XMLDB_KEY_UNIQUE, array('pushid', 'platform'));
$dbman->drop_key($table, $key);
}
upgrade_main_savepoint(true, 2014051201.03);
}
return true;
}
-10
View File
@@ -1119,16 +1119,6 @@ class core_user_external extends external_api {
return $warnings;
}
// The same key can't exists for the same platform.
if ($DB->get_record('user_devices', array('pushid' => $params['pushid'], 'platform' => $params['platform']))) {
$warnings['warning'][] = array(
'item' => $params['pushid'],
'warningcode' => 'existingkeyforplatform',
'message' => 'This key is already stored for other device using the same platform'
);
return $warnings;
}
$userdevice = new stdclass;
$userdevice->userid = $USER->id;
$userdevice->appid = $params['appid'];
+1 -1
View File
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2014051201.02; // 20140512 = branching date YYYYMMDD - do not modify!
$version = 2014051201.03; // 20140512 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.