Index: modules/aggregator/aggregator.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.admin.inc,v retrieving revision 1.26 diff -u -p -r1.26 aggregator.admin.inc --- modules/aggregator/aggregator.admin.inc 29 Apr 2009 07:18:04 -0000 1.26 +++ modules/aggregator/aggregator.admin.inc 3 May 2009 16:27:56 -0000 @@ -73,7 +73,7 @@ function aggregator_form_feed(&$form_sta $form['url'] = array('#type' => 'textfield', '#title' => t('URL'), '#default_value' => isset($feed->url) ? $feed->url : '', - '#maxlength' => 255, + '#maxlength' => 65535, '#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.20 diff -u -p -r1.20 aggregator.install --- modules/aggregator/aggregator.install 22 Dec 2008 19:38:31 -0000 1.20 +++ modules/aggregator/aggregator.install 3 May 2009 16:27:56 -0000 @@ -124,10 +124,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( @@ -143,10 +141,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 <link> element in the feed.', ), 'description' => array( @@ -191,7 +187,7 @@ function aggregator_schema() { ), 'primary key' => array('fid'), 'unique keys' => array( - 'url' => array('url'), + 'url' => array(array('url', 255)), 'title' => array('title'), ), ); @@ -218,10 +214,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( @@ -252,6 +246,8 @@ function aggregator_schema() { 'primary key' => array('iid'), 'indexes' => array( 'fid' => array('fid'), + 'link' => array(array('link', 255)), + 'guid' => array('guid'), ), ); @@ -266,3 +262,18 @@ function aggregator_update_7000() { db_add_field($ret, 'aggregator_feed', 'hash', array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '')); return $ret; } + +/** + * Allow longer URLs and add an index on aggregator_item.guid and aggregator_item.link. + */ +function aggregator_update_7001() { + $ret = array(); + db_drop_unique_key($ret, 'aggregator_feed', 'url'); + db_change_field($ret, 'aggregator_feed', 'url', 'url', array('type' => 'text', 'not null' => TRUE)); + db_change_field($ret, 'aggregator_feed', 'link', 'link', array('type' => 'text', 'not null' => TRUE)); + db_change_field($ret, 'aggregator_item', 'link', 'link', array('type' => 'text', 'not null' => TRUE)); + db_add_index($ret, 'aggregator_item', 'guid', array('guid')); + db_add_index($ret, 'aggregator_item', 'link', array(array('link', 255))); + db_add_unique_key($ret, 'aggregator_feed', 'url', array(array('url', 255))); + return $ret; +} Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.406 diff -u -p -r1.406 aggregator.module --- modules/aggregator/aggregator.module 26 Apr 2009 19:59:31 -0000 1.406 +++ modules/aggregator/aggregator.module 3 May 2009 16:27:56 -0000 @@ -479,6 +479,7 @@ function aggregator_save_feed($edit) { 'block' => $edit['block'], 'description' => '', 'image' => '', + 'link' => '', )) ->execute(); @@ -510,8 +511,8 @@ 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' => '',