Permalink
Browse files

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

…iption (but different names)
  • Loading branch information...
sam_marshall
sam_marshall committed May 24, 2007
1 parent 16ba216 commit 36be12128cc0be7c860e2e3c26643959d2d95635
Showing with 4 additions and 3 deletions.
  1. +4 −3 backup/restorelib.php
View
@@ -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;

0 comments on commit 36be121

Please sign in to comment.