If I try to assign more than one category to a feed source (at aggregator/categories/$id/configure) and save the changes when I go back to the config page only one is selected.
So there's no way to select more than one category,

CommentFileSizeAuthor
#5 865970.patch3.82 KBswentel
#3 865970.patch1.08 KBswentel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcvangend’s picture

Priority: Critical » Major

This is not critical, maybe not even major. See http://drupal.org/node/45111.

dodorama’s picture

Priority: Major » Normal

I did that by mistake, I guess this is normal.

swentel’s picture

Status: Active » Needs review
FileSize
1.08 KB

Could reproduce this. It's because the query is using db_merge() but the primary key fid is the same when there are more categories selected. So the first time it will insert, second time update the existing previous record. Using db_insert fixes this and is not a problem since all categories for a feed are deleted anyway at the top of the function.

Patch attached fixes this.

andypost’s picture

Let's add a test to predict this regression in future

swentel’s picture

FileSize
3.82 KB

Now with test.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Great! It works! db_merge() was wrong because same feed could be in drupal & security categories at sametime.

aggregator_save_feed() actually deletes all categories if FID provided

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Looks good. Committed to CVS HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.