Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
date_ical
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
drupal.org
date_ical
Commits
3c164489
Commit
3c164489
authored
Jul 20, 2015
by
Robert Rollins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #2206109: Fixed RRULE import to work with newest Feeds version.
Thanks go to d.o user MegaChriz for this fix!
parent
eb767269
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
date_ical.module
date_ical.module
+9
-1
libraries/ParserVcalendar.inc
libraries/ParserVcalendar.inc
+2
-0
tests/multiple_rrule_exceptions.ics
tests/multiple_rrule_exceptions.ics
+0
-1
No files found.
date_ical.module
View file @
3c164489
...
...
@@ -256,14 +256,22 @@ function date_ical_sanitize_text($text = '') {
* @param string $target
* The machine name of the field into which this RRULE shall be parsed,
* with ":rrule" appended to the end.
* @param string $repeat_rule
* @param string
|array
$repeat_rule
* The repeat rule string, formatted like "$rrule|$rdate|$exrule|$exdate".
* Newer versions of Feeds send this value as an array containing the string.
*/
function
date_ical_feeds_set_rrule
(
$source
,
$entity
,
$target
,
$repeat_rule
)
{
if
(
empty
(
$repeat_rule
))
{
// Don't alter the entity if there's no repeat rule.
return
;
}
if
(
is_array
(
$repeat_rule
))
{
// Newer versions of Feeds return $repeat_rule as an array containing the
// string we returned from ParseVcalendar::parseRepeatProperty().
$repeat_rule
=
reset
(
$repeat_rule
);
}
// $target looks like <field_name>:rrule, but we only need <field_name>.
$field_name
=
current
(
explode
(
':'
,
$target
,
2
));
// Parse the repeat rule into RRULE, RDATE, EXRULE, and EXDATE strings.
...
...
libraries/ParserVcalendar.inc
View file @
3c164489
...
...
@@ -450,6 +450,7 @@ class ParserVcalendar {
// Due to a few bugs and limitations with Date Repeat, we need to massage
// the RRULE a bit.
if
(
count
(
$vcalendar_component
->
rrule
)
>
1
)
{
// TODO: Is Date Repeat still limited to 1 RRULE with Feeds 2.0-beta1?
$msg
=
'The event with UID %uid has multiple RRULEs, but the Date Repeat module only supports one. Only the first RRULE in the event will be used.
If your events need to have a complex repeat pattern, using RDATEs should help.'
;
watchdog
(
'date_ical'
,
$msg
,
array
(
'%uid'
=>
$uid
),
'warning'
);
...
...
@@ -462,6 +463,7 @@ class ParserVcalendar {
}
foreach
(
$vcalendar_component
->
rrule
as
&
$rrule_data
)
{
// RRULEs must have an INTERVAL, or Date Repeat will throw errors.
// TODO: Is this still true with Feeds 2.0-beta1?
if
(
!
isset
(
$rrule_data
[
'value'
][
'INTERVAL'
]))
{
$rrule_data
[
'value'
][
'INTERVAL'
]
=
'1'
;
}
...
...
tests/multiple_rrule_exceptions.ics
View file @
3c164489
...
...
@@ -38,4 +38,3 @@ SUMMARY:Debugging event.
END:VEVENT
END:VCALENDAR
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment