Going to aggregator/sources/1/categorize and clicking checkboxes produces the desired result (items are categorizes), but it also produces one of these errors for every checked checkbox:
warning: Invalid argument supplied for foreach() in /var/www/vaster/modules/aggregator/aggregator.module on line 1138.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | aggregator-categorize-47.patch | 999 bytes | rstamm |
| #4 | agg_category_form.patch | 1.05 KB | joshk |
Comments
Comment #1
joshk commentedI was incorrect. It throws four errors no matter how many checkboxes.
Comment #2
joshk commentedThe error is in aggregator_page_list_submit(). It's running through each form_value and treating them all the same. Here are the form values:
The last four, of course, are the problem.
Proposed Fix:
My immediate though it just to throw in an additional conditional which checks to see if the value of the form_value is an array. It's also running unneceesary db_queries trying to "DELETE FROM {aggregator_category_item} WHERE iid = 'token'", which isn't really good.
The other option would be to make the form itself a bit smarter and have the iid values in a tree so they could be spidered alone. This is probably better as it's more friendly to future form_alters and the like.
Any thoughts?
Comment #3
joshk commentedPossible fixes:
I like the latter the best, and it doesn't seem to cause any problems. However, my first attempt to make it a tree didn't produce the desired results.
Comment #4
joshk commentedOk, I've implemented the #tree solution. I think this is best because:
This patch was made against HEAD.
Comment #5
mfredrickson commentedReviewed at TC Drupal Bug Hunt
This patch works as advertised and I agree with the solution. Wrapping the values inside of a '#tree' protects them from colliding with other elements that are form_altered in later.
+1
Comment #6
rstamm commentedPatch solves issue in Drupal 4.7.
Comment #7
Steven commentedTested and verified. Committed to HEAD.
Comment #8
killes@www.drop.org commentedapplied
Comment #9
(not verified) commented