Fix missing event title issue of meetup ical import
Event titles were not upgraded or imported from meetup.com group ical sources. This patch is fixing that problem, the node title assigned at feeds_presave. Change-Id: I71fefbd0e919e31cd5bdf313790873c621bc678f
This commit is contained in:
parent
7612522fe2
commit
3452f57a26
|
@ -191,6 +191,22 @@ function groups_feeds_user_groups_import($job) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Join two url parts trimming the last path separator properly.
|
||||
*
|
||||
* @param $base
|
||||
* base url.
|
||||
* @param $path
|
||||
* fragment to be append.
|
||||
* @return
|
||||
* Concated url fragments.
|
||||
*/
|
||||
function _groups_feeds_join_url($base, $path) {
|
||||
$url = rtrim($base, '/');
|
||||
$url .= $path;
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Meetup events import worker.
|
||||
*
|
||||
|
@ -203,7 +219,7 @@ function groups_feeds_user_groups_import($job) {
|
|||
function groups_feeds_meetup_events_import($job) {
|
||||
$meetup_links = groups_feeds_get_meetup_links();
|
||||
foreach ($meetup_links as $meetup_link) {
|
||||
$url = $meetup_link['url'].'/events/ical/';
|
||||
$url = _groups_feeds_join_url($meetup_link['url'], '/events/ical/');
|
||||
$feedSource = feeds_source('ical_feed_importer');
|
||||
$config = $feedSource->getConfig();
|
||||
$config['FeedsHTTPFetcher']['source'] = $url;
|
||||
|
@ -422,7 +438,7 @@ function groups_feeds_get_meetup_links() {
|
|||
* @param class $node node prepared to save
|
||||
*/
|
||||
function groups_feeds_node_presave($node) {
|
||||
if ($node->type == 'page') {
|
||||
if (($node->type == 'page') || ($node->type == 'event')) {
|
||||
// set title attribute of node
|
||||
$node->title = $node->title_field['und'][0]['value'];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue