diff --git a/modules/aggregator/aggregator.processor.inc b/modules/aggregator/aggregator.processor.inc index 7fa86a9ad83ee239b9dabfb32822cc0d1c102ceb..3f1319c8c118de093cbd48206a4474564df14d11 100644 --- a/modules/aggregator/aggregator.processor.inc +++ b/modules/aggregator/aggregator.processor.inc @@ -38,8 +38,9 @@ function aggregator_aggregator_process($feed) { $item['timestamp'] = isset($entry->timestamp) ? $entry->timestamp : REQUEST_TIME; } - // Make sure the item title fits in 255 varchar column. + // Make sure the item title and author fit in the 255 varchar column. $item['title'] = truncate_utf8($item['title'], 255, TRUE, TRUE); + $item['author'] = truncate_utf8($item['author'], 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/aggregator.test b/modules/aggregator/aggregator.test index 24205fccac1498c1215f3322059abbfee56faeba..d74b5416f539c44320e7cb883fa4de664228100a 100644 --- a/modules/aggregator/aggregator.test +++ b/modules/aggregator/aggregator.test @@ -583,9 +583,9 @@ class RemoveFeedItemTestCase extends AggregatorTestCase { // Update and remove items two times in a row to make sure that removal // resets all 'modified' information (modified, etag, hash) and allows for // immediate update. - $this->updateAndRemove($feed, 2); - $this->updateAndRemove($feed, 2); - $this->updateAndRemove($feed, 2); + $this->updateAndRemove($feed, 4); + $this->updateAndRemove($feed, 4); + $this->updateAndRemove($feed, 4); // Delete feed. $this->deleteFeed($feed); } @@ -943,6 +943,15 @@ class FeedParserTestCase extends AggregatorTestCase { $this->assertText('First example feed item title'); $this->assertLinkByHref('http://example.com/example-turns-one'); $this->assertText('First example feed item description.'); + + // Several additional items that include elements over 255 characters. + $this->assertRaw("Second example feed item title."); + $this->assertText('Long link feed item title'); + $this->assertText('Long link feed item description'); + $this->assertLinkByHref('http://example.com/tomorrow/and/tomorrow/and/tomorrow/creeps/in/this/petty/pace/from/day/to/day/to/the/last/syllable/of/recorded/time/and/all/our/yesterdays/have/lighted/fools/the/way/to/dusty/death/out/out/brief/candle/life/is/but/a/walking/shadow/a/poor/player/that/struts/and/frets/his/hour/upon/the/stage/and/is/heard/no/more/it/is/a/tale/told/by/an/idiot/full/of/sound/and/fury/signifying/nothing'); + $this->assertText('Long author feed item title'); + $this->assertText('Long author feed item description'); + $this->assertLinkByHref('http://example.com/long/author'); } /** diff --git a/modules/aggregator/tests/aggregator_test_rss091.xml b/modules/aggregator/tests/aggregator_test_rss091.xml index f39a2732c03459b79be2b51ca4f6b1f4dc117be7..29440227fcf22fda378b9fa1c5c85065cabd7448 100644 --- a/modules/aggregator/tests/aggregator_test_rss091.xml +++ b/modules/aggregator/tests/aggregator_test_rss091.xml @@ -26,5 +26,16 @@ http://example.com/example-turns-two Second example feed item description. + + Long link feed item title. + http://example.com/tomorrow/and/tomorrow/and/tomorrow/creeps/in/this/petty/pace/from/day/to/day/to/the/last/syllable/of/recorded/time/and/all/our/yesterdays/have/lighted/fools/the/way/to/dusty/death/out/out/brief/candle/life/is/but/a/walking/shadow/a/poor/player/that/struts/and/frets/his/hour/upon/the/stage/and/is/heard/no/more/it/is/a/tale/told/by/an/idiot/full/of/sound/and/fury/signifying/nothing + Long link feed item description. + + + Long author feed item title. + http://example.com/long/author + I wanted to get out and walk eastward toward the park through the soft twilight, but each time I tried to go I became entangled in some wild, strident argument which pulled me back, as if with ropes, into my chair. Yet high over the city our line of yellow windows must have contributed their share of human secrecy to the casual watcher in the darkening streets, and I was him too, looking up and wondering. I was within and without, simultaneously enchanted and repelled by the inexhaustible variety of life. + Long author feed item description. +