Use 'default' as default group when reading filters from history

This was NULL for old entries, because no default was added
in I758795f01eaf3ff56c5720d660cd989ef95764a7 (see T263324)

Bug: T269314
Change-Id: I5af8b0d3a9d7b6d2570cf79bbbe8b5b170ba1230
This commit is contained in:
DannyS712 2020-12-03 05:09:57 +00:00 committed by Daimona Eaytoy
parent 753a0dc482
commit 0fb033775f

View file

@ -312,6 +312,11 @@ class FilterLookup implements IDBAccessObject {
private function getFilterFromHistory( stdClass $row ) : Filter {
$af_row = new stdClass;
if ( $row->afh_group === null ) {
// FIXME Make the field NOT NULL and add default (T263324)
$row->afh_group = 'default';
}
foreach ( AbuseFilter::HISTORY_MAPPINGS as $af_col => $afh_col ) {
$af_row->$af_col = $row->$afh_col;
}