[#2960] Fix for importing Yahoo Calendar CSV data
Summary Fix for importing Yahoo Calendar CSV data
Queue Kronolith
Queue Version HEAD
Type Enhancement
State Resolved
Priority 1. Low
Requester kevin_myer (at) iu13 (dot) org
Created 2005-11-12 (4879 days ago)
Updated 2005-11-12 (4879 days ago)
Resolved 2005-11-12 (4879 days ago)
Patch No

2005-11-12 11:11:39 Jan Schneider Comment #2
State ⇒ Resolved
Reply to this comment
Makes sense. Committed, thanks.
2005-11-12 02:02:42 kevin_myer (at) iu13 (dot) org Comment #1
Type ⇒ Enhancement
State ⇒ New
Priority ⇒ 1. Low
Summary ⇒ Fix for importing Yahoo Calendar CSV data
Queue ⇒ Kronolith
Reply to this comment
I have a data file from a Yahoo Calendar dump, in CSV format.  It 
contains a large number of entries that have no end date.  Because of 
a check in the Kronolith Driver, this causes the import to fail.  The 
following patch allows the data to import successfully, by making the 
assumption that if no end date is given, use the start date.  However, 
I have no idea if this possibly breaks something else, so if someone 
else could look at it that knows about what it might affect, I'd 
appreciate it.

Index: Driver.php


RCS file: /repository/kronolith/lib/Driver.php,v

retrieving revision 1.153

diff -u -r1.153 Driver.php

--- Driver.php  7 Nov 2005 05:50:50 -0000       1.153

+++ Driver.php  12 Nov 2005 01:56:13 -0000

@@ -766,7 +766,7 @@

              return PEAR::raiseError(_("Events must have a start date."));


          if (empty($hash['duration']) && empty($hash['end_date'])) {

-            return PEAR::raiseError(_("Events must have an end date 
or a duration."));

+            $hash['end_date'] = $hash['start_date'];


          if (!empty($hash['duration'])) {

              $weeks = str_replace('W', '', $hash['duration'][1]);

Saved Queries