? sites/default/files ? sites/default/private ? sites/default/settings.php Index: modules/aggregator/aggregator.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.admin.inc,v retrieving revision 1.43 diff -u -p -r1.43 aggregator.admin.inc --- modules/aggregator/aggregator.admin.inc 18 Sep 2009 00:12:45 -0000 1.43 +++ modules/aggregator/aggregator.admin.inc 19 Sep 2009 23:08: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.26 diff -u -p -r1.26 aggregator.install --- modules/aggregator/aggregator.install 10 Sep 2009 06:38:17 -0000 1.26 +++ modules/aggregator/aggregator.install 19 Sep 2009 23:08: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( @@ -192,7 +188,7 @@ function aggregator_schema() { ), 'primary key' => array('fid'), 'unique keys' => array( - 'url' => array('url'), + 'url' => array(array('url', 255)), 'title' => array('title'), ), ); @@ -219,10 +215,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 +238,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 +256,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() { @@ -270,9 +268,31 @@ function aggregator_update_7000() { db_add_field($ret, 'aggregator_feed', 'hash', array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '')); return $ret; } + /** * Add aggregator teaser length to settings from old global default teaser length */ function aggregator_update_7001() { + $ret = array(); variable_set('aggregator_teaser_length', variable_get('teaser_length')); + return $ret; +} + +/** + * Allow longer URLs and add indexes on aggregator_item columns guid and link. + */ +function aggregator_update_7002() { + $ret = array(); + db_drop_unique_key($ret, 'aggregator_feed', 'url'); + db_change_field($ret, 'aggregator_feed', 'url', 'url', array('type' => 'text', 'not null' => TRUE, 'description' => 'URL to the feed.')); + db_change_field($ret, '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($ret, 'aggregator_item', 'link', 'link', array('type' => 'text', 'not null' => TRUE, 'description' => 'Link to the feed item.')); + db_change_field($ret, 'aggregator_item', 'guid', 'guid', array('type' => 'text', 'not null' => TRUE, 'description' => 'Unique identifier for the feed item.')); + db_add_unique_key($ret, 'aggregator_feed', 'url', array(array('url', 255))); + return $ret; } + +/** + * @} 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.423 diff -u -p -r1.423 aggregator.module --- modules/aggregator/aggregator.module 18 Sep 2009 00:04:22 -0000 1.423 +++ modules/aggregator/aggregator.module 19 Sep 2009 23:08:18 -0000 @@ -309,7 +309,7 @@ function aggregator_permission() { * Checks 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 )); @@ -473,6 +473,7 @@ function aggregator_save_feed($edit) { 'url' => $edit['url'], 'refresh' => $edit['refresh'], 'block' => $edit['block'], + 'link' => '', )) ->execute(); } @@ -504,6 +505,7 @@ function aggregator_save_feed($edit) { 'block' => $edit['block'], 'description' => '', 'image' => '', + 'link' => '', )) ->execute(); @@ -536,15 +538,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.4 diff -u -p -r1.4 aggregator.parser.inc --- modules/aggregator/aggregator.parser.inc 15 Jul 2009 21:32:43 -0000 1.4 +++ modules/aggregator/aggregator.parser.inc 19 Sep 2009 23:08:18 -0000 @@ -129,14 +129,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'])) {