Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-9932 Fixed calendar restore of events on same day with same descr…

…iption (but different names)
  • Loading branch information...
commit 36be12128cc0be7c860e2e3c26643959d2d95635 1 parent 16ba216
sam_marshall authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 backup/restorelib.php
7 backup/restorelib.php
@@ -2461,9 +2461,10 @@ function restore_create_events($restore,$xml_file) {
$eve->visible = backup_todb($info['EVENT']['#']['VISIBLE']['0']['#']);
$eve->timemodified = backup_todb($info['EVENT']['#']['TIMEMODIFIED']['0']['#']);
- //Now search if that event exists (by description and timestart field) in
- //restore->course_id course
- $eve_db = get_record("event","courseid",$eve->courseid,"description",$eve->description,"timestart",$eve->timestart);
+ //Now search if that event exists (by name, description, timestart fields) in
+ //restore->course_id course
+ $eve_db = get_record_select("event",
+ "courseid={$eve->courseid} AND name='{$eve->name}' AND description='{$eve->description}' AND timestart=$eve->timestart");
//If it doesn't exist, create
if (!$eve_db) {
$create_event = true;
Please sign in to comment.
Something went wrong with that request. Please try again.