Page MenuHomePhabricator

Special:CentralNotice shows broken text in "short lists"
Closed, ResolvedPublic

Description

Punctuation is strange and something is missing from the list, for example: "DE; : (All except )"

Steps to reproduce:

  • Set a campaign to include one or more countries but without selecting any specific regions.
  • Visit Special:CentralNotice

image.png (480×838 px, 69 KB)

Event Timeline

Change 833757 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/CentralNotice@master] Convert configuration into class const

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

Change 833775 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/CentralNotice@master] Move short-list helper into a dedicated class

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

I haven't been able to reproduce this locally, but uselang=qqx shows where the data is missing:

AT(comma-separator)CH(comma-separator)DE(comma-separator)LI(and)(word-separator)LU; : ((centralnotice-all-except: ))

Looking at the database with this query,

select * from cn_notices
left join cn_notice_countries on not_id = nc_notice_id
left join cn_notice_regions on not_id = nr_notice_id
where not_name='WikiCon 2022 in Germany';

there are only linked countries, no regions. The countries match the list above.

Reproducing the bug locally is simple, I see. Selecting any combination of countries but not changing the region selection will result in a rendered list like "CH; : (Alle außer )". Deselecting at least one region results in a correct rendering like "CH: (Alle außer UR)".

Change 834490 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/CentralNotice@master] Detect empty list of countries or regions

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

awight added a project: Wikimedia-Fundraising.

To be clear, the "Detect empty list" patch fixes the original bug, and the other two patches are just optional clean-up.

Change 834490 merged by jenkins-bot:

[mediawiki/extensions/CentralNotice@master] Detect empty list of countries or regions

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

Problem is fixed on the beta cluster where many campaigns are set with countries and no regions, so previously buggy.

image.png (150×252 px, 8 KB)

ReleaseTaggerBot added a project: MW-1.40-notes (1.40.0-wmf.3; 2022-09-26).Mon, Sep 26, 16:00

I don't believe this is correct. Can ReleaseTaggerBot be taught about the wmf_deploy branch for CentralNotice?

Change 833757 merged by jenkins-bot:

[mediawiki/extensions/CentralNotice@master] Convert configuration into class const

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

Pcoombe assigned this task to awight.
Pcoombe subscribed.

Confirmed this is fixed on production. Thanks Adam!