summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-10-04 14:45:04 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-10-04 14:45:04 -0700
commit85875f3ac90cb5c4421517dab9339259cd0f81d6 (patch)
tree9b5ab843569ac7fed2b069c15ef6cdda726c796a
parentd967abdf1dab8b23fba39ce2aa35fe09cd5578f5 (diff)
downloadbrdo-85875f3ac90cb5c4421517dab9339259cd0f81d6.tar.gz
brdo-85875f3ac90cb5c4421517dab9339259cd0f81d6.tar.bz2
Issue #1244116 by catch: Fixed Feed items with title longer than 255 characters fail to insert into aggregator_item().
-rw-r--r--modules/aggregator/aggregator.processor.inc3
-rw-r--r--modules/aggregator/tests/aggregator_test_rss091.xml2
2 files changed, 4 insertions, 1 deletions
diff --git a/modules/aggregator/aggregator.processor.inc b/modules/aggregator/aggregator.processor.inc
index 6eb2c662f..79261b618 100644
--- a/modules/aggregator/aggregator.processor.inc
+++ b/modules/aggregator/aggregator.processor.inc
@@ -37,6 +37,9 @@ function aggregator_aggregator_process($feed) {
if (!$item['timestamp']) {
$item['timestamp'] = isset($entry->timestamp) ? $entry->timestamp : REQUEST_TIME;
}
+
+ // Make sure the item title fits in 255 varchar column.
+ $item['title'] = truncate_utf8($item['title'], 255, TRUE, TRUE);
aggregator_save_item(array('iid' => (isset($entry->iid) ? $entry->iid : ''), 'fid' => $feed->fid, 'timestamp' => $item['timestamp'], 'title' => $item['title'], 'link' => $item['link'], 'author' => $item['author'], 'description' => $item['description'], 'guid' => $item['guid']));
}
}
diff --git a/modules/aggregator/tests/aggregator_test_rss091.xml b/modules/aggregator/tests/aggregator_test_rss091.xml
index 1fd5320d3..f39a2732c 100644
--- a/modules/aggregator/tests/aggregator_test_rss091.xml
+++ b/modules/aggregator/tests/aggregator_test_rss091.xml
@@ -22,7 +22,7 @@
<description>First example feed item description.</description>
</item>
<item>
- <title>Second example feed item title</title>
+ <title>Second example feed item title. This title is extremely long so that it exceeds the 255 character limit for titles in feed item storage. In fact it's so long that this sentence isn't long enough so I'm rambling a bit to make it longer, nearly there now. Ah now it's long enough so I'll shut up.</title>
<link>http://example.com/example-turns-two</link>
<description>Second example feed item description.</description>
</item>