Page MenuHomePhabricator

permission log is not displayed correctly for changes coming from the central-wiki
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue:

Screenshot 2026-06-30 204944.png (1,569×135 px, 53 KB)
https://he.wikipedia.org/w/index.php?title=Special:Logs&logid=19665620&uselang=en

What happens?:
Since no permissions were added in this log entry, the granted field is displayed and is empty

What should have happened instead?:
If no permissions were granted, the granted field should not be displayed at all...

Other information:
Interestingly, the log is displayed correctly on meta:

image.png (1,555×136 px, 53 KB)
https://meta.wikimedia.org/w/index.php?title=Special:Log&logid=172829

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

The parameters stored for this log entry are unusual:

mysql:research@dbstore1008.eqiad.wmnet [hewiki]> select log_params from logging where log_id=19665620;
a:2:{s:12:"4::oldgroups";a:1:{i:0;s:5:"sysop";}s:12:"5::newgroups";a:1:{i:0;s:0:"";}}
php > var_dump( unserialize( 'a:2:{s:12:"4::oldgroups";a:1:{i:0;s:5:"sysop";}s:12:"5::newgroups";a:1:{i:0;s:0:"";}}' ) );
array(2) {
  ["4::oldgroups"]=>
  array(1) {
    [0]=>
    string(5) "sysop"
  }
  ["5::newgroups"]=>
  array(1) {
    [0]=>
    string(0) ""
  }
}

So newgroups is an array containing the empty string ([ "" ]).

We have code to handle old log entries where newgroups (or oldgroups) is just an empty string, but not that: https://gerrit.wikimedia.org/g/mediawiki/core/+/cc27c177c72edacbc6ef88e222dfe25753d3d3ee/includes/Logging/RightsLogFormatter.php#477

Ah, this was recently backfilled: T6055 and I guess it's a bug in the script used for that. We can handle this when displaying.

Change #1307835 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] RightsLogFormatter: Handle weird backfilled log entries

https://gerrit.wikimedia.org/r/1307835

Change #1307835 merged by jenkins-bot:

[mediawiki/core@master] RightsLogFormatter: Handle weird backfilled log entries

https://gerrit.wikimedia.org/r/1307835