In the new version, aggregator_menu() says:

  $items['admin/content/aggregator/edit/feed/%aggregator_feed'] = array(
    'title' => 'Edit feed',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('aggregator_form_feed', 5),
    'access arguments' => array('administer news feeds'),
    'type' => MENU_CALLBACK,
  );

But the function aggregator_form_feed() takes $edit as an argument.

  function aggregator_form_feed($edit = array('refresh' => 900, 'title' => '', 'url' => '', 'fid' => NULL)) {

If I understand the new menu system correctly, 'page arguments' => array('aggregator_form_feed', 5), means "Send arg(5) [the feed id] to the function aggregator_form_feed()." Since that function is expecting the $edit array(), the page loads an empty form.

Attached patch corrects the behavior by rewriting:

  function aggregator_form_feed($fid, $edit = array('refresh' => 900, 'title' => '', 'url' => '', 'fid' => NULL)) {

But I'm not entirely sure this is the proper fix, as $fid is never invoked with the function. But it works.

Marking 'critical' because it is a total failure of the function.

Comments

agentrickard’s picture

Status: Active » Needs review

Code needs review.

agentrickard’s picture

Title: Aggregator menu error aggregator/edit/FID » Aggregator forms error aggregator/edit/FID
Component: aggregator.module » forms system
StatusFileSize
new932 bytes

After talking with chx in IIRC, this seems to be a FAPI3 implementation bug, so moving to that queue.

As written, the function:

function aggregator_form_feed($edit = array('refresh' => 900, 'title' => '', 'url' => '', 'fid' => NULL))

Returns only the $form_state value, which needs to be expressed in the function.

function aggregator_form_feed(&$form_state, $edit = array('refresh' => 900, 'title' => '', 'url' => '', 'fid' => NULL))

New patch attached

agentrickard’s picture

StatusFileSize
new1.37 KB

Same problem with aggregator_category_form(). new patch

agentrickard’s picture

StatusFileSize
new1.37 KB

Might help if I passed by reference correctly.

dvessel’s picture

Status: Needs review » Reviewed & tested by the community

Errors are gone when adding feeds and categories.

I do get a notice when saving a feed but it's not related to this patch.

notice: Undefined index: fid in /Users/joon/Sites/projects/DRUPAL-HEAD/modules/aggregator/aggregator.module on line 561.
dvessel’s picture

And the issue for that's here.. http://drupal.org/node/132369

So, this one's RTBC.!

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed!

Anonymous’s picture

Status: Fixed » Closed (fixed)