Skip to content

Fix: Undefined tab panel TypeError in CreateWiki form - #6

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/createwiki-tab-panel-error
Open

Fix: Undefined tab panel TypeError in CreateWiki form#6
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/createwiki-tab-panel-error

Conversation

@sentry

@sentry sentry Bot commented Aug 20, 2026

Copy link
Copy Markdown

This commit addresses a TypeError: undefined is not an object (evaluating 'panel.$element') that occurs in modules/ext.createwiki.oouiform.ooui.js.

The root cause was identified as enhancePanel() being called with an undefined panel object. This happened because switchCreateWikiTab() was invoked with an undefined tab name (derived from $("[id*=mw-section-]").attr("id") when no such element existed on pages like Special:RequestWikiQueue), causing tabs.getCurrentTabPanel() to return undefined.

The fix implements two safeguards:

  1. A null guard has been added at the beginning of the enhancePanel() function to prevent dereferencing $element on an undefined panel.
  2. In the hashchange event handler, specifically for the hash === '' branch, a check has been added to ensure that $("[id*=mw-section-]") actually finds an element before attempting to retrieve its id and call switchCreateWikiTab.

Fixes MEDIAWIKI-CC8

This PR was automatically generated by Sentry. You can adjust this setting at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants