Commit 0b6a73ad authored by Robert Rollins's avatar Robert Rollins

Applied patch #11 from [#1922658] to get around iCalcreator limitation with...

Applied patch #11 from [#1922658] to get around iCalcreator limitation with stream wrappers. Also made the amount of whitespace on blank lines consistent throughout the project.
parent 3fb327ec
......@@ -148,7 +148,7 @@ function hook_date_ical_icalcreator_component_alter(&$component, &$context) {
function hook_date_ical_feeds_object_alter(&$value, &$context) {
// Example of what might be done with this alter hook
if ($context['property_key'] == 'dtstart') {
// Tweak the parsed FeedsDateTime object for the start time.
// Tweak the parsed FeedsDateTime object created from the start time.
// ...
}
}
......@@ -209,7 +209,6 @@ function date_ical_feeds_set_rrule($source, $entity, $target, $feed_element) {
* giving up completely.
*/
function date_ical_build_repeating_dates($rrule = NULL, $rrule_values = NULL, $field, $item) {
module_load_include('inc', 'date_api', 'date_api_ical');
$field_name = $field['field_name'];
......
......@@ -81,16 +81,17 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
// Get the path to the temporary file created by the feed download.
$filename = $fetcher_result->getFilePath();
$config = $source->getConfig();
//
// Create the calendar object and parse the file.
//
$config = array(
'unique_id' => '', // do we need one for incoming parsing?
'url' => $filename, // it's a stream wrapper, so url
'filename' => $config['FeedsHTTPFetcher']['source'],
);
$calendar = new vcalendar($config);
if (!$calendar->parse()) {
if (!$calendar->parse($fetcher_result->getRaw())) {
throw new DateIcalParseException(t('Error parsing %source iCal file %file', array('%source' => 'todo', '%file' => $filename)));
}
......@@ -227,12 +228,12 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
$start_array['tz'] = $start_prop['params']['TZID'];
}
// On single-day All Day events (the start date + 1 = the end date), just ignore the DTEND
// if the Date All Day module is installed. Otherwise it'll be displayed strangely.
if ($start_array['year'] == $date_array['year']
&& $start_array['month'] == $date_array['month']
&& $start_array['day'] + 1 == $date_array['day']
&& module_exists('date_all_day')) {
// On single-day All Day events (the start date + 1 = the end date), just ignore the DTEND
// if the Date All Day module is installed. Otherwise it'll be displayed strangely.
return;
}
}
......@@ -265,7 +266,11 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
$tz = NULL;
if (isset($date_array['tz'])) {
$tz = $date_array['tz'];
// 'Z' == 'Zulu' == 'UTC'. DateTimeZone won't acept Z, so change it to UTC.
if (strtoupper($date_array['tz']) == 'Z') {
$date_array['tz'] = 'UTC';
}
$tz = new DateTimeZone($date_array['tz']);
}
else {
// If there was no timezone in the date array itself, add one if we have one.
......
......@@ -327,7 +327,6 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
}
$value = $new_byday;
}
$new_rrule[$key] = $value;
}
return $new_rrule;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment