Skip to content
Snippets Groups Projects
Commit 5eab30f6 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #87497 by Souvent22: aggregator not always pulling in descriptions.

parent 66d69c26
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -658,7 +658,6 @@ function aggregator_element_end($parser, $name) { ...@@ -658,7 +658,6 @@ function aggregator_element_end($parser, $name) {
*/ */
function aggregator_element_data($parser, $data) { function aggregator_element_data($parser, $data) {
global $channel, $element, $items, $item, $image, $tag; global $channel, $element, $items, $item, $image, $tag;
switch ($element) { switch ($element) {
case 'ITEM': case 'ITEM':
$items[$item][$tag] .= $data; $items[$item][$tag] .= $data;
...@@ -889,6 +888,9 @@ function aggregator_parse_feed(&$data, $feed) { ...@@ -889,6 +888,9 @@ function aggregator_parse_feed(&$data, $feed) {
else if ($item['SUMMARY']) { else if ($item['SUMMARY']) {
$item['DESCRIPTION'] = $item['SUMMARY']; $item['DESCRIPTION'] = $item['SUMMARY'];
} }
else if ($item['CONTENT']) {
$item['DESCRIPTION'] = $item['CONTENT'];
}
/* /*
** Try to resolve and parse the item's publication date. If no ** Try to resolve and parse the item's publication date. If no
...@@ -1062,13 +1064,14 @@ function aggregator_page_category() { ...@@ -1062,13 +1064,14 @@ function aggregator_page_category() {
function aggregator_page_list($sql, $header, $categorize) { function aggregator_page_list($sql, $header, $categorize) {
$form['#base'] = 'aggregator_page_list'; $form['#base'] = 'aggregator_page_list';
$form['header'] = array('#value' => $header); $form['header'] = array('#value' => $header);
$form['#id'] = 'aggregator';
$result = pager_query($sql, 20); $result = pager_query($sql, 20);
$categories = array(); $categories = array();
$done = FALSE; $done = FALSE;
$form['items'] = array(); $form['items'] = array();
while ($item = db_fetch_object($result)) { while ($item = db_fetch_object($result)) {
$form['items'][$item->iid] = array('#value' => theme('aggregator_page_item', $item)); $form[$item->iid]['items'] = array('#value' => theme('aggregator_page_item', $item));
$form['categories'][$item->iid] = array(); $form[$item->iid]['categories'] = array();
if ($categorize) { if ($categorize) {
$categories_result = db_query('SELECT c.cid, c.title, ci.iid FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid AND ci.iid = %d', $item->iid); $categories_result = db_query('SELECT c.cid, c.title, ci.iid FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid AND ci.iid = %d', $item->iid);
$selected = array(); $selected = array();
...@@ -1081,7 +1084,7 @@ function aggregator_page_list($sql, $header, $categorize) { ...@@ -1081,7 +1084,7 @@ function aggregator_page_list($sql, $header, $categorize) {
} }
} }
$done = TRUE; $done = TRUE;
$form['categories'][$item->iid] = array( $form[$item->iid]['categories'] = array(
'#type' => variable_get('aggregator_category_selector', 'checkboxes'), '#type' => variable_get('aggregator_category_selector', 'checkboxes'),
'#default_value' => $selected, '#options' => $categories, '#default_value' => $selected, '#options' => $categories,
'#size' => 10, '#multiple' => TRUE '#size' => 10, '#multiple' => TRUE
...@@ -1107,8 +1110,8 @@ function _aggregator_page_list($sql, $op, $header = '') { ...@@ -1107,8 +1110,8 @@ function _aggregator_page_list($sql, $op, $header = '') {
else { else {
$output = '<div id="aggregator">'; $output = '<div id="aggregator">';
$output .= $header; $output .= $header;
foreach ($form['items'] as $item) { foreach ($form as $item) {
$output .= $item['#value']; $output .= $item['items']['#value'];
} }
$output .= '</div>'; $output .= '</div>';
$output .= $form['pager']['#value']; $output .= $form['pager']['#value'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment