The fixGlobalBlockWhitelist.php maintenance script can be used to fix rows in the global_block_whitelist table by fixing the gbw_id value as well as deleting any orphaned rows (where there is no associated gb_id in the globalblocks table).
This script needs several improvements:
- The code needs to use the SelectQueryBuilder (T312329)
- Selecting rows from global_block_whitelist is not batched
- The code will fail if multiple broken whitelist entries exist for the same target when a global block for that target exists.
- There are no tests for the code and there should be if it is being automatically run weekly on production
Acceptance criteria
- The fixGlobalBlockWhitelist.php is well tested and uses the SelectQueryBuilder over calls to ::select.
- The maintenance script properly handles batching and duplicate broken whitelist rows