From 425b8d5f97bacad379568e9f4d8cc3eee24ee6fb Mon Sep 17 00:00:00 2001 From: KevinPaxman Date: Wed, 4 Dec 2013 17:36:31 -0800 Subject: [PATCH] Issue #2150071: Added support for the Location module. Thanks, kpaxman! --- date_ical.module | 1 + includes/date_ical_plugin_row_ical_entity.inc | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/date_ical.module b/date_ical.module index 23f143b..8f162dc 100644 --- a/date_ical.module +++ b/date_ical.module @@ -332,6 +332,7 @@ function _date_ical_get_location_fields($base = 'node') { 'text_with_summary', 'node_reference', 'addressfield', + 'location' ); if (!$info || !in_array($info['type'], $supported_location_fields)) { continue; diff --git a/includes/date_ical_plugin_row_ical_entity.inc b/includes/date_ical_plugin_row_ical_entity.inc index f9167d6..35f7f34 100644 --- a/includes/date_ical_plugin_row_ical_entity.inc +++ b/includes/date_ical_plugin_row_ical_entity.inc @@ -259,6 +259,24 @@ class date_ical_plugin_row_ical_entity extends views_plugin_row { } $location = implode(', ', array_reverse($locations)); } + elseif ($location_info['type'] == 'location') { + $included_fields = array( + 'name', + 'additional', + 'street', + 'city', + 'province_name', + 'postal_code', + 'country_name' + ); + $location_data = array(); + foreach ($included_fields as $included_field) { + if (!empty($location_field[$included_field])) { + $locations_data[] = $location_field[$included_field]; + } + } + $location = check_plain(implode(', ', $location_data)); + } else { $location = check_plain($location_field['value']); } -- GitLab