Index: modules/aggregator/aggregator.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v
retrieving revision 1.436
diff -u -p -r1.436 aggregator.module
--- modules/aggregator/aggregator.module	26 Feb 2010 00:11:58 -0000	1.436
+++ modules/aggregator/aggregator.module	23 Mar 2010 07:44:28 -0000
@@ -209,7 +209,7 @@ function aggregator_menu() {
   $items['aggregator/categories/%aggregator_category/categorize'] = array(
     'title' => 'Categorize',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('aggregator_page_category', 2),
+    'page arguments' => array('aggregator_page_category_form', 2),
     'access arguments' => array('administer news feeds'),
     'type' => MENU_LOCAL_TASK,
     'file' => 'aggregator.pages.inc',
@@ -238,7 +238,7 @@ function aggregator_menu() {
   $items['aggregator/sources/%aggregator_feed/categorize'] = array(
     'title' => 'Categorize',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('aggregator_page_source', 2),
+    'page arguments' => array('aggregator_page_source_form', 2),
     'access arguments' => array('administer news feeds'),
     'type' => MENU_LOCAL_TASK,
     'file' => 'aggregator.pages.inc',
Index: modules/aggregator/aggregator.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.pages.inc,v
retrieving revision 1.39
diff -u -p -r1.39 aggregator.pages.inc
--- modules/aggregator/aggregator.pages.inc	18 Jan 2010 03:31:29 -0000	1.39
+++ modules/aggregator/aggregator.pages.inc	23 Mar 2010 07:44:29 -0000
@@ -23,19 +23,13 @@ function aggregator_page_last() {
 /**
  * Menu callback; displays all the items captured from a particular feed.
  *
- * If there are two arguments then this function is the categorize form.
+ * @param $feed
+ *   The feed for which to display all items.
  *
- * @param $arg1
- *   If there are two arguments then $arg1 is $form_state. Otherwise, $arg1 is $feed.
- * @param $arg2
- *   If there are two arguments then $arg2 is feed.
  * @return
- *   The item's HTML.
+ *   The rendered list of items for a feed.
  */
-function aggregator_page_source($arg1, $arg2 = NULL) {
-  // If there are two arguments then this function is the categorize form, and
-  // $arg1 is $form_state and $arg2 is $feed. Otherwise, $arg1 is $feed.
-  $feed = is_object($arg2) ? $arg2 : $arg1;
+function aggregator_page_source($feed) {
   drupal_set_title($feed->title);
   $feed_source = theme('aggregator_feed_source', array('feed' => $feed));
 
@@ -47,22 +41,30 @@ function aggregator_page_source($arg1, $
 }
 
 /**
- * Menu callback; displays all the items aggregated in a particular category.
+ * Menu callback; displays a form with all items captured from a feed.
  *
- * If there are two arguments then this function is called as a form.
+ * @param $feed
+ *   The feed for which to list all the aggregated items.
  *
- * @param $arg1
- *   If there are two arguments then $arg1 is $form_state. Otherwise, $arg1 is $category.
- * @param $arg2
- *   If there are two arguments then $arg2 is $category.
  * @return
- *   The items HTML.
+ *   The rendered list of items for a feed.
+ *
+ * @see aggregator_page_source()
  */
-function aggregator_page_category($arg1, $arg2 = NULL) {
-  // If there are two arguments then we are called as a form, $arg1 is
-  // $form_state and $arg2 is $category. Otherwise, $arg1 is $category.
-  $category = is_array($arg2) ? $arg2 : $arg1;
+function aggregator_page_source_form($form, $form_state, $feed) {
+  return aggregator_page_source($feed);
+}
 
+/**
+ * Menu callback; displays all the items aggregated in a particular category.
+ *
+ * @param $category
+ *   The category for which to list all the aggregated items.
+ *
+ * @return
+*   The rendered list of items for a category.
+ */
+function aggregator_page_category($category) {
   drupal_add_feed(url('aggregator/rss/' . $category['cid']), variable_get('site_name', 'Drupal') . ' ' . t('aggregator - @title', array('@title' => $category['title'])));
 
   // It is safe to include the cid in the query because it's loaded from the
@@ -73,6 +75,21 @@ function aggregator_page_category($arg1,
 }
 
 /**
+ * Menu callback; displays a form containing items aggregated in a category.
+ *
+ * @param $category
+ *   The category for which to list all the aggregated items.
+ *
+ * @return
+*   The rendered list of items for a category.
+ *
+ * @see aggregator_page_category()
+ */
+function aggregator_page_category_form($form, $form_state, $category) {
+  return aggregator_page_category($category);
+}
+
+/**
  * Load feed items
  *
  * @param $type
Index: modules/aggregator/aggregator.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.test,v
retrieving revision 1.38
diff -u -p -r1.38 aggregator.test
--- modules/aggregator/aggregator.test	26 Feb 2010 00:11:58 -0000	1.38
+++ modules/aggregator/aggregator.test	23 Mar 2010 07:44:29 -0000
@@ -283,6 +283,8 @@ class AddFeedTestCase extends Aggregator
     $this->drupalGet('aggregator/sources/' . $feed->fid);
     $this->assertResponse(200, t('Feed source exists.'));
     $this->assertText($feed->title, t('Page title'));
+    $this->drupalGet('aggregator/sources/' . $feed->fid . '/categorize');
+    $this->assertResponse(200, t('Feed categorization page exists.'));
 
     // Delete feed.
     $this->deleteFeed($feed);
