Commit 5a75b9dd authored by mglaman's avatar mglaman Committed by Robert Rollins

Issue #2342933: Added option to silence Indefinite COUNT replacement warning.

Thanks go to user mgalman for the patch!
parent 0e07183c
......@@ -85,6 +85,7 @@ class DateiCalFeedsParser extends FeedsParser {
public function configDefaults() {
return array(
'indefinite_count' => '52',
'indefinite_message_display' => TRUE,
'until_not_utc' => FALSE,
'skip_days' => NULL,
);
......@@ -107,6 +108,12 @@ class DateiCalFeedsParser extends FeedsParser {
'#description' => t('Indefinitely repeating events are not supported. The repeat count will instead be set to this number.'),
'#default_value' => $this->config['indefinite_count'],
);
$form['indefinite_message_display'] = array(
'#title' => t('Display message when RRULE is missing COUNT'),
'#type' => 'checkbox',
'#default_value' => $this->config['indefinite_message_display'],
'#description' => t('Display a message when an indefinitely repeating rule is adjusted by the "Indefinite COUNT" setting above.'),
);
$form['until_not_utc'] = array(
'#title' => t('RRULE UNTILs are not in UTC'),
'#type' => 'checkbox',
......
......@@ -448,17 +448,19 @@ class ParserVcalendar {
$rrule_data['value']['INTERVAL'] = '1';
}
if (!isset($rrule_data['value']['COUNT']) && !isset($rrule_data['value']['UNTIL'])) {
if ((!isset($rrule_data['value']['COUNT']) && !isset($rrule_data['value']['UNTIL']))) {
$msg = "The event with UID %uid has an indefinitely repeating RRULE, which the Date Repeat module doesn't support.
As a workaround, Date iCal set the repeat count to @count. This value can be customized in the iCal parser settings.";
watchdog('date_ical', $msg, array('%uid' => $uid, '@count' => $count), WATCHDOG_WARNING);
drupal_set_message(
t("At least one of the events in this iCal feed has an indefinitely repeating RRULE, which the Date Repeat module doesn't support.<br>
As a workaround, Date iCal set the repeat count to @count. This value can be customized in the iCal parser settings.",
array('@count' => $count)),
'warning',
FALSE
);
if ($this->config['indefinite_message_display']) {
drupal_set_message(
t("At least one of the events in this iCal feed has an indefinitely repeating RRULE, which the Date Repeat module doesn't support.<br>
As a workaround, Date iCal set the repeat count to @count. This value can be customized in the iCal parser settings.",
array('@count' => $count)),
'warning',
FALSE
);
}
$rrule_data['value']['COUNT'] = $this->config['indefinite_count'];
}
}
......
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