-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #767 from USEPA/EPAD8-1808-add-to-calendar-descrip…
…tion [EPAD8-1808] - adds add_to_cal_description field to events, creates n…
- Loading branch information
Showing
10 changed files
with
151 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
services/drupal/config/sync/field.field.node.event.field_add_to_cal_description.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
uuid: d7b30d87-1c87-4324-b4c6-bf6c298691d3 | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- field.storage.node.field_add_to_cal_description | ||
- node.type.event | ||
module: | ||
- custom_add_another | ||
third_party_settings: | ||
custom_add_another: | ||
custom_add_another: '' | ||
custom_remove: '' | ||
id: node.event.field_add_to_cal_description | ||
field_name: field_add_to_cal_description | ||
entity_type: node | ||
bundle: event | ||
label: 'Add to Calendar Description' | ||
description: 'Event description that goes with the Add to Calendar button.' | ||
required: false | ||
translatable: false | ||
default_value: { } | ||
default_value_callback: '' | ||
settings: { } | ||
field_type: string_long |
19 changes: 19 additions & 0 deletions
19
services/drupal/config/sync/field.storage.node.field_add_to_cal_description.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
uuid: 2958cd2c-88c9-4842-9098-22dcc36521a2 | ||
langcode: en | ||
status: true | ||
dependencies: | ||
module: | ||
- node | ||
id: node.field_add_to_cal_description | ||
field_name: field_add_to_cal_description | ||
entity_type: node | ||
type: string_long | ||
settings: | ||
case_sensitive: false | ||
module: core | ||
locked: false | ||
cardinality: 1 | ||
translatable: true | ||
indexes: { } | ||
persist_with_no_fields: false | ||
custom_storage: false |
23 changes: 23 additions & 0 deletions
23
...upal/patches/addtocal-escape_location_commas-3319571-3-rolled-to-apply-on-3311870-2.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/src/Plugin/AddToCal/Type/Generic.php b/src/Plugin/AddToCal/Type/Generic.php | ||
index 755f412..aacd882 100644 | ||
--- a/src/Plugin/AddToCal/Type/Generic.php | ||
+++ b/src/Plugin/AddToCal/Type/Generic.php | ||
@@ -110,6 +110,9 @@ class Generic extends AddToCalTypeBase { | ||
$title = Html::escape($info['title']); | ||
$description = str_replace(PHP_EOL, '\n', $info['description']); | ||
|
||
+ // Apple Calendar wants commas escaped in the location field. | ||
+ $location = str_replace(',','\,',$info['location']); | ||
+ | ||
$ics = <<<ICS | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
@@ -121,7 +124,7 @@ DTSTART:{$info['rfc3339']['start']} | ||
DTEND:{$info['rfc3339']['end']} | ||
SUMMARY:{$title} | ||
DESCRIPTION:{$description} | ||
-LOCATION:{$info['location']} | ||
+LOCATION:{$location} | ||
END:VEVENT | ||
END:VCALENDAR | ||
ICS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters