mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-12-21 09:52:48 +00:00
916234598d
This deals with data inconsistencies in buildFilterEditor. Every property of $row was tested in all 5 scenarios (also using Selenium) to check when it's set. The result is in the normalizeRow method, which aims to remove any inconsistencies, so that buildFilterEditor always receives a "complete" row with all defaults set. The code in buildFilterEditor is now cleaner (because there are no isset() checks), and it gives us a unique place where we can set defaults (rather than partly doing that in loadRequest/loadFilterData/loadImport, and partly relying on isset). This will be especially useful when introducing value objects to represent filters, because now you just have to look at normalizeRow() to tell which properties are allowed to be missing, and thus what "kind" of filter object you need (see I5f33227887c035e301313bbe24d1c1fefb75bc6a). Additionally, reduce the properties that get passed around during export/import, and make the selenium test try a roundtrip, rather than relying on hardcoded data that may get outdated. A future patch will refactor the import/export code. Change-Id: Id52c466baaf6da18e2981f27a81ffdad3a509e78 |
||
---|---|---|
.. | ||
editingFilters.js | ||
importingFilters.js | ||
ViewList.basic.js |