Page MenuHomePhabricator

Codex Special:Block console error: can't convert null to object
Closed, ResolvedPublicBUG REPORT

Description

With the following config:

$wgEnableMultiBlocks = false;
$wgUseCodexSpecialBlock = true;
$wgEnablePartialActionBlocks = false;

I'm getting this error:

TypeError: can't convert null to object
    js http://localhost/w/load.php?debug=2&lang=en&modules=mediawiki.special.block.codex&skin=freo&version=ztntf:12
    runScript http://localhost/w/load.php?debug=2&lang=en&modules=startup&only=scripts&raw=1&skin=freo:1285
    …

Here’s the derived requirement, BDD scenario, and test steps based on the issue:

Derived Requirement

Ensure that no console error occurs when loading the Codex Special:Block page, specifically the "can't convert null to object" error, under the following configurations: $wgEnableMultiBlocks = false, $wgUseCodexSpecialBlock = true, and $wgEnablePartialActionBlocks = false.

BDD

gherkin
Feature: Error-Free Loading of Codex Special:Block Page

Scenario: Ensure no console error occurs when loading the Codex Special:Block page
  Given the following configurations:
    - $wgEnableMultiBlocks = false
    - $wgUseCodexSpecialBlock = true
    - $wgEnablePartialActionBlocks = false
  When the user navigates to the Special:Block page
  Then no console error such as "can't convert null to object" should appear

Test Result - Local

Status: ✅ PASS / ❓Need More Info / ❌ FAIL
Environment: Local
OS: macOS Sonoma 15.0
Browser: Chrome 130
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Ensure No Console Error Appears on Special:Block Page

  1. Set the following configurations:
    • $wgEnableMultiBlocks = false
    • $wgUseCodexSpecialBlock = true
    • $wgEnablePartialActionBlocks = false
  2. Navigate to the Special:Block page.
  3. ✅❓❌⬜ AC1: Open the browser’s developer console and confirm that no "TypeError: can't convert null to object" error appears.

QA Results - Local

ACStatusDetails
1T377448#10248757

Event Timeline

Change #1081135 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] Special:Block [Vue]: Handle partialBlockActionOptions being null

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

Change #1081135 merged by jenkins-bot:

[mediawiki/core@master] SpecialBlock: Handle partialBlockActionOptions being null

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

@Samwilson I didn't see the issue with the latest commit, but I tried an old one out of curiosity to see the issue, and I couldn't replicate it. Can you review my gif below to see if I'm missing anything to replicate the error?

Test Result - Local

Status: ❓Need More Info
Environment: Local
OS: macOS Sonoma 15.0
Browser: Chrome 130
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1081135

http://localhost:8080/wiki/Special:Block

Test Steps

Test Case 1: Ensure No Console Error Appears on Special:Block Page

  1. Set the following configurations:
    • $wgEnableMultiBlocks = false
    • $wgUseCodexSpecialBlock = true
    • $wgEnablePartialActionBlocks = false
  2. Navigate to the Special:Block page.
  3. AC1: Open the browser’s developer console and confirm that no "TypeError: can't convert null to object" error appears.

2024-10-21_15-58-53.mp4.gif (1×1 px, 1 MB)

MusikAnimal subscribed.

I think we came up with a means to test it at https://wikimedia.slack.com/archives/C05QYAMAV4G/p1729526567836379 – where I said:

If you want to see the bug in action, the easiest way to is to checkout the patch that fixed the bug, then reset back one commit (to before the bug was fixed). So try going to https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1081135 then under "Download" copy the "Checkout" command, run it. Then run git reset @~1 --hard

Did that work for you? If not, I'd say it's fine to move this done… Going by code review alone we can see that the bug is fixed.

I think we've tested this enough; it's a small thing, and we'll notice quick enough if it's still happening.