ViewEdit: add af_id to the row

A PHP notice is sporadically emitted in production, e.g. reqId XlVEMgpAMNAAA6zMVhQAAACV

Change-Id: Ie42d00c6520aa31daf127c5df9515a3ab01d986f
This commit is contained in:
Daimona Eaytoy 2020-02-25 18:30:37 +00:00
parent 58d531861c
commit fe28aff82a
2 changed files with 2 additions and 1 deletions

View file

@ -1241,6 +1241,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
if ( $filter !== 'new' ) {
// These aren't needed when saving the filter, but they are otherwise (e.g. if
// saving fails and we need to show the edit interface again).
$row->af_id = $origRow->af_id;
$row->af_user = $origRow->af_user;
$row->af_user_text = $origRow->af_user_text;
$row->af_timestamp = $origRow->af_timestamp;

View file

@ -104,7 +104,7 @@ class AbuseFilterSaveTest extends MediaWikiTestCase {
->getMock();
if ( $existing ) {
$origValues = [ (object)self::$defaultFilterRow, [] ];
$origValues = [ (object)( self::$defaultFilterRow + [ 'af_id' => 1 ] ), [] ];
} else {
$origValues = [
(object)[