summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/views_rss_core/views_rss_core.module20
-rw-r--r--views_rss.module8
2 files changed, 15 insertions, 13 deletions
diff --git a/modules/views_rss_core/views_rss_core.module b/modules/views_rss_core/views_rss_core.module
index ebc5cfe..74d4078 100644
--- a/modules/views_rss_core/views_rss_core.module
+++ b/modules/views_rss_core/views_rss_core.module
@@ -152,42 +152,36 @@ function views_rss_core_views_rss_item_elements() {
function views_rss_core_views_rss_date_sources() {
$sources['node'] = array(
'pubDate' => array(
- 'field' => 'created',
'table' => 'node',
- 'alias' => 'pubDate',
+ 'field' => 'created',
),
'lastBuildDate' => array(
- 'field' => 'changed',
'table' => 'node',
- 'alias' => 'lastBuildDate',
+ 'field' => 'changed',
),
);
$sources['node_revisions'] = array(
'pubDate' => array(
- 'field' => 'timestamp',
'table' => 'node_revisions',
- 'alias' => 'pubDate',
+ 'field' => 'timestamp',
),
);
$sources['comments'] = array(
- 'pubDate' => array(
- 'field' => 'timestamp',
+ 'lastBuildDate' => array(
'table' => 'comments',
- 'alias' => 'pubDate',
+ 'field' => 'timestamp',
),
);
$sources['files'] = array(
'pubDate' => array(
- 'field' => 'timestamp',
'table' => 'files',
- 'alias' => 'pubDate',
+ 'field' => 'timestamp',
),
);
$sources['users'] = array(
'pubDate' => array(
- 'field' => 'created',
'table' => 'users',
- 'alias' => 'pubDate',
+ 'field' => 'created',
),
);
return $sources;
diff --git a/views_rss.module b/views_rss.module
index 5faa99d..371bb5f 100644
--- a/views_rss.module
+++ b/views_rss.module
@@ -163,6 +163,14 @@ function views_rss_get_date_sources() {
foreach (module_implements('views_rss_date_sources') as $module) {
$module_date_sources = call_user_func($module . '_views_rss_date_sources');
if (isset($module_date_sources) && is_array($module_date_sources)) {
+ // Add field aliases if not provided by hook.
+ foreach ($module_date_sources as $base_table => $elements) {
+ foreach ($elements as $element_name => $definition) {
+ if (!isset($definition['alias'])) {
+ $module_date_sources[$base_table][$element_name]['alias'] = $element_name;
+ }
+ }
+ }
$date_sources[$module] = $module_date_sources;
}
}