Closed (outdated)
Project:
Event
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Oct 2008 at 20:55 UTC
Updated:
13 Apr 2018 at 21:01 UTC
Jump to comment: Most recent
When using event and location modules together you may get a php fatal error that complains about a call to undefined function. The function is called in event.module around line 830 and references location_form2api. I could not find that function anywhere in the latest Location 3 module(other than in the API reference text). This is what I did to fix:
if (module_exists('location')) {
if (isset($node->locations[0])) {
/*added this line */
$posted_locations[0] = $node->locations[0];
/* no longer support in location ??? so i commented it out - may cause issues for some field formats?
$posted_locations[0] = location_form2api($node->locations[0]);
if (!isset($posted_locations[0]['city']) || strlen(trim($posted_locations[0]['city'])) == 0) {
$postal_data = location_get_postalcode_data($posted_locations[0]);
$posted_locations[0]['city'] = isset($postal_data['city']) ? $postal_data['city'] : '';
}
if (!isset($posted_locations[0]['province']) || strlen(trim($posted_locations[0]['province'])) == 0) {
$postal_data = isset($postal_data) ? $postal_data : location_get_postalcode_data($posted_locations[0]);
$posted_locations[0]['province'] = isset($postal_data['province']) ? $postal_data['province'] : '';
}
*/
if ($output = theme('locations', $posted_locations, variable_get('location_suppress_country', 0) ? array('country') : array())) {
$event['location'] = $output;
}
}
}
The feed now works in iCal but I noticed that it's full of html. Perhaps converting to plain would be wise? But that would be another issue.
Comments
Comment #1
socialnicheguru commentedsubscribing
Comment #2
Anonymous (not verified) commentedsubscribing; I had the same issue - thanks for you useful posting!
Comment #3
japerryEvent for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.