openrightsgroup / blocked-org-uk

Template front-end code, markup, style-sheets, images and other assets for the Censorship Monitoring Project (blocked.org.uk)
https://www.blocked.org.uk/
GNU General Public License v3.0
13 stars 5 forks source link

Bug: Reports are still showing up in site category filter after category has been changed #379

Closed alexhaydock closed 5 years ago

alexhaydock commented 5 years ago

Hi @dantheta,

Just doing some housekeeping work on the "Alcohol" related sites.

I've been switching the category for some sites away from just "Alcohol" and over to "Alcohol related non-alcohol sales"

I've been removing the Alcohol category when I do this so that there's only one category present for each site, but some of the sites are still showing up in the category filter for "Alcohol"

For example:

Still shows up on this page:

edjw commented 5 years ago

@dantheta – Can you clarify whether this bug this affecting the count of items in the original category?

dantheta commented 5 years ago

The filter selection and reports were ignoring the "enabled" flag on the URL <-> category association table. Both have been fixed now. This aggected the paging counts in the report filter setting, and the counts on the ISP report URL category stats.

Merge was also not setting the enabled flag on the target category, so some URLs were added to the target category but in the disabled state.

The URL <-> category table has an enabled state for the non-ORG categories. If an admin decides to override a categorify categorization, we can't simply delete the association because the next time categorify runs it will add it back again.