Closed (fixed)
Project:
Drupal core
Version:
x.y.z
Component:
aggregator.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Oct 2006 at 18:12 UTC
Updated:
17 Oct 2006 at 21:15 UTC
Jump to comment: Most recent file
Comments
Comment #1
Kjartan commentedUpdated patch that fixes everything in a much more elegant way, and saving re-categorization actually works! Also merged in the missing fixes from #83573.
Thanks to chx for putting up with all my annoying fapi questions.
Comment #2
chx commented$form = drupal_retrieve_form('aggregator_page_list', $sql, $header, $categorize);after this, I have no idea why that #base is needed. The form_id isaggregator_page_list, why are you setting #base then? Here is an excerpt from form.inc:and
I skip the #submit code, but clearly, setting #base to $form_id serves no purpose.
Comment #3
Kjartan commentedAhh, you would think so, but alas no. All drupal_retrieve_form does is get the form data. drupal_get_form does the submit/validate/theme stuff, and it is called from the menu callback:
drupal_get_form('aggregator_page_source', $feed)
aggregator_page_source() gets the $feed data, and passes it on to _aggregator_page_list, which drupal_retrive_form('aggregator_page_list'). This is fine and dandy to get the form, but since drupal_get_form() is using a completely different form id ('aggregator_page_source') none of the hooks get called. Now if 'aggregator_page_list' were just called from one function we could just rename stuff and call the right thing initially, but it is also used in drupal_get_form('aggregator_page_category'). Hence the use of #base to force drupal_get_form() to call the proper callbacks, without having to duplicate all the callbacks for aggregator_page_source/aggregator_page_category.
Comment #4
chx commentedI am blind. I thought that retrieve is a get. Sorry.
Comment #5
Kjartan commentedComment #6
(not verified) commented