Problem/Motivation

As part of #1971384: [META] Convert page callbacks to controllers we are converting the aggregator form callbacks to FormInterface. The two forms at /aggregator/categories/{cid}/categorize and /aggregator/sources/{aggregator_feed}/categorize share much of the same code, only the list of feed items is filtered differently: one by the source feed it comes from, and one by category.

The existing code uses form callbacks that wrap page callbacks, that then call common protected code that either builds a render array or a form array depending on a switch... It gets confusing.

FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch Convert aggregator_page_category_form to a Controller-2040199-13.patch. Unable to apply patch. See the log in the details link for more information. View

FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch issue-2038291-Convert language_admin_add_form to a Controller.patch. Unable to apply patch. See the log in the details link for more information. View

FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch issue-2038291-Convert language_admin_add_form to a Controller.patch. Unable to apply patch. See the log in the details link for more information. View

so far code attached
it has this error:
Fatal error: Call to undefined method Drupal\aggregator\Form\AggregatorCategoryForm::pageCategory() in /www/web/drupal/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php on line 54

this is a _form callback and should be converted as such. But, in order to figure out what happens here you need to check _aggregator_page_list the very first conditional...

so, here a pretty hacky thing is done:)
You should copy the logic from aggregator_categorize_items and aggregator_categorize_items_submit after doing the aggregator_load_feed_items call.
Ignore everything else.

FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch Convert aggregator_page_category_form to a Controller-2040199-13.patch. Unable to apply patch. See the log in the details link for more information. View

More than 80 chars and not a well-structured sentence. Also lower case r. Perhaps Remove once aggregator_load_feed_items() is .... See https://drupal.org/node/2043581. replace the ... with whatever its going to be (eg method on storage controller).

This patch combines aggregator_page_source_form() and aggregator_page_category_form() into a new base form class that takes care of the common form building functionality provided by aggregator_categorize_items() and two sub-classes.

Why isn't this just buildForm(), and these could call parent::buildForm()?

Or, even better.
ImageEffectFormBase has a similar need to this, but the base class specifies abstract protected function prepareImageEffect($image_effect);, and just calls that in buildForm in the base, so each child is required to specify its effect loading.

Hm. A bit concerned about this. The generic "SomethingSomethigBase" name makes it sound like it's a class intended to be extended by other modules, but it's extremely Aggregator module specific. Can we throw "Aggregator" in the class name? (Yes, I realize it's namespaced to aggregator module, but I'm not sure people will get that when it comes up as a class they see in their IDE.)