Commit 19f807b7 authored by Gábor Hojtsy's avatar Gábor Hojtsy

#201468 by blackdog: fix notice in aggregator, when categorization form is...

#201468 by blackdog: fix notice in aggregator, when categorization form is saved without picking a category
parent 10bccd75
......@@ -190,11 +190,13 @@ function aggregator_categorize_items_validate($form_id, &$form) {
* Process aggregator_categorize_items form submissions.
*/
function aggregator_categorize_items_submit($form, &$form_state) {
foreach ($form_state['values']['categories'] as $iid => $selection) {
db_query('DELETE FROM {aggregator_category_item} WHERE iid = %d', $iid);
foreach ($selection as $cid) {
if ($cid) {
db_query('INSERT INTO {aggregator_category_item} (cid, iid) VALUES (%d, %d)', $cid, $iid);
if (!empty($form_state['values']['categories'])) {
foreach ($form_state['values']['categories'] as $iid => $selection) {
db_query('DELETE FROM {aggregator_category_item} WHERE iid = %d', $iid);
foreach ($selection as $cid) {
if ($cid) {
db_query('INSERT INTO {aggregator_category_item} (cid, iid) VALUES (%d, %d)', $cid, $iid);
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment