Index: modules/aggregator/aggregator.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.admin.inc,v retrieving revision 1.44 diff -u -p -r1.44 aggregator.admin.inc --- modules/aggregator/aggregator.admin.inc 9 Oct 2009 00:59:55 -0000 1.44 +++ modules/aggregator/aggregator.admin.inc 1 Nov 2009 16:30:18 -0000 @@ -72,7 +72,7 @@ function aggregator_form_feed($form, &$f $form['url'] = array('#type' => 'textfield', '#title' => t('URL'), '#default_value' => isset($feed->url) ? $feed->url : '', - '#maxlength' => 255, + '#maxlength' => NULL, '#description' => t('The fully-qualified URL of the feed.'), '#required' => TRUE, ); Index: modules/aggregator/aggregator.install =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.install,v retrieving revision 1.27 diff -u -p -r1.27 aggregator.install --- modules/aggregator/aggregator.install 29 Sep 2009 15:13:54 -0000 1.27 +++ modules/aggregator/aggregator.install 1 Nov 2009 16:30:18 -0000 @@ -125,10 +125,8 @@ function aggregator_schema() { 'description' => 'Title of the feed.', ), 'url' => array( - 'type' => 'varchar', - 'length' => 255, + 'type' => 'text', 'not null' => TRUE, - 'default' => '', 'description' => 'URL to the feed.', ), 'refresh' => array( @@ -144,10 +142,8 @@ function aggregator_schema() { 'description' => 'Last time feed was checked for new items, as Unix timestamp.', ), 'link' => array( - 'type' => 'varchar', - 'length' => 255, + 'type' => 'text', 'not null' => TRUE, - 'default' => '', 'description' => 'The parent website of the feed; comes from the element in the feed.', ), 'description' => array( @@ -191,8 +187,10 @@ function aggregator_schema() { ) ), 'primary key' => array('fid'), + 'indexes' => array( + 'url' => array(array('url', 255)), + ), 'unique keys' => array( - 'url' => array('url'), 'title' => array('title'), ), ); @@ -219,10 +217,8 @@ function aggregator_schema() { 'description' => 'Title of the feed item.', ), 'link' => array( - 'type' => 'varchar', - 'length' => 255, + 'type' => 'text', 'not null' => TRUE, - 'default' => '', 'description' => 'Link to the feed item.', ), 'author' => array( @@ -244,9 +240,8 @@ function aggregator_schema() { 'description' => 'Posted date of the feed item, as a Unix timestamp.', ), 'guid' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, + 'type' => 'text', + 'not null' => TRUE, 'description' => 'Unique identifier for the feed item.', ) ), @@ -263,6 +258,11 @@ function aggregator_schema() { } /** + * @defgroup updates-6.x-to-7.x System updates from 6.x to 7.x + * @{ + */ + +/** * Add hash column to aggregator_feed table. */ function aggregator_update_7000() { @@ -275,3 +275,20 @@ function aggregator_update_7000() { function aggregator_update_7001() { variable_set('aggregator_teaser_length', variable_get('teaser_length')); } + +/** + * Allow longer URLs and add indexes on aggregator_item columns guid and link. + */ +function aggregator_update_7002() { + db_drop_unique_key('aggregator_feed', 'url'); + db_change_field('aggregator_feed', 'url', 'url', array('type' => 'text', 'not null' => TRUE, 'description' => 'URL to the feed.')); + db_change_field('aggregator_feed', 'link', 'link', array('type' => 'text', 'not null' => TRUE, 'description' => 'The parent website of the feed; comes from the element in the feed.')); + db_change_field('aggregator_item', 'link', 'link', array('type' => 'text', 'not null' => TRUE, 'description' => 'Link to the feed item.')); + db_change_field('aggregator_item', 'guid', 'guid', array('type' => 'text', 'not null' => TRUE, 'description' => 'Unique identifier for the feed item.')); + db_add_index('aggregator_feed', 'url', array(array('url', 255))); +} + +/** + * @} End of "defgroup updates-6.x-to-7.x" + * The next series of updates should start at 8000. + */ Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.427 diff -u -p -r1.427 aggregator.module --- modules/aggregator/aggregator.module 23 Oct 2009 22:24:11 -0000 1.427 +++ modules/aggregator/aggregator.module 1 Nov 2009 16:30:18 -0000 @@ -309,7 +309,7 @@ function aggregator_permission() { * Queues news feeds for updates once their refresh interval has elapsed. */ function aggregator_cron() { - $result = db_query('SELECT * FROM {aggregator_feed} WHERE checked + refresh < :time AND refresh != :never', array( + $result = db_query('SELECT * FROM {aggregator_feed} WHERE checked + refresh < :time AND refresh <> :never', array( ':time' => REQUEST_TIME, ':never' => AGGREGATOR_CLEAR_NEVER )); @@ -485,6 +485,7 @@ function aggregator_save_feed($edit) { 'url' => $edit['url'], 'refresh' => $edit['refresh'], 'block' => $edit['block'], + 'link' => '', )) ->execute(); } @@ -516,6 +517,7 @@ function aggregator_save_feed($edit) { 'block' => $edit['block'], 'description' => '', 'image' => '', + 'link' => '', )) ->execute(); @@ -548,15 +550,13 @@ function aggregator_remove($feed) { // Call hook_aggregator_remove() on all modules. module_invoke_all('aggregator_remove', $feed); // Reset feed. - db_merge('aggregator_feed') - ->key(array('fid' => $feed->fid)) + db_update('aggregator_feed') + ->condition('fid', $feed->fid) ->fields(array( 'checked' => 0, 'hash' => '', 'etag' => '', 'modified' => 0, - 'description' => $feed->description, - 'image' => $feed->image, )) ->execute(); } Index: modules/aggregator/aggregator.parser.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.parser.inc,v retrieving revision 1.6 diff -u -p -r1.6 aggregator.parser.inc --- modules/aggregator/aggregator.parser.inc 12 Oct 2009 15:54:59 -0000 1.6 +++ modules/aggregator/aggregator.parser.inc 1 Nov 2009 16:30:18 -0000 @@ -118,14 +118,18 @@ function aggregator_parse_feed(&$data, $ $item['title'] = ''; } - // Resolve the items link. + // Resolve the item's link. if (!empty($item['link'])) { $item['link'] = $item['link']; } else { $item['link'] = $feed->link; } - $item['guid'] = isset($item['guid']) ? $item['guid'] : ''; + + // Resolve the item's GUID. + if (!isset($item['guid'])) { + $item['guid'] = ''; + } // Atom feeds have a content and/or summary tag instead of a description tag. if (!empty($item['content:encoded'])) {