Page MenuHomePhabricator

OOui undefined error when loading template wizard userscript on en.wp on Safari
Closed, ResolvedPublic

Description

https://en.wikipedia.org/w/index.php?title=User:Samwilson/TemplateWizard.js&action=raw&ctype=text/javascript at line 39: TypeError: undefined is not an object (evaluating 'OO.ui.Widget')

I installed the script as a userscript and I seem to have an undefined error on every page load. Didn't investigate further.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Niharika added subscribers: Samwilson, Niharika.

@TheDJ can you tell us which browser were you using? Which editor did you try this on?
I'm wondering if you have something in the global/common.js which causes this. We've had a few people try it out so far and this is the first bug report of this kind.

Probably related: the OOUI error reported at T191194#4107092. Sam said the dependency will be fixed in the extension version of TemplateWizard (T191194#4107014)

Something tells me TheDJ isn't on IE.

Hehe I doubt it too, but it sounds like the same error, and is on the same line in the code.

It happens on Firefox too, on Wikisource. I can't get it to happen with the extension though, so haven't really looked into what load order or other confusion is causing it. The gadget is loading oojs-ui-core which should be enough, but I guess sometimes other things are happening. :-(

It happens on Firefox too, on Wikisource. I can't get it to happen with the extension though, so haven't really looked into what load order or other confusion is causing it. The gadget is loading oojs-ui-core which should be enough, but I guess sometimes other things are happening. :-(

:(

@TheDJ would you be willing to try it out on a different browser maybe? We'd appreciate your opinion of it. The gadget is only meant as a prototype so it's not going to be as polished as the extension.

It happens on Firefox too, on Wikisource. I can't get it to happen with the extension though, so haven't really looked into what load order or other confusion is causing it. The gadget is loading oojs-ui-core which should be enough, but I guess sometimes other things are happening. :-(

:(

@TheDJ would you be willing to try it out on a different browser maybe? We'd appreciate your opinion of it. The gadget is only meant as a prototype so it's not going to be as polished as the extension.

I use Safari, with the 2010 WikiEditor. Sorry, should have stated that. I also have the error in Chrome. The error only seems to occur on article pages (so when i'm outside of wikitext edit mode).

Note that I have a LOT of scripts installed, and often that tends to mess with the execution order/timing of things, so maybe it has something to do with that.

Got it OO.inheritClass( mediaWiki.TemplateWizard.TemplateForm, OO.ui.Widget ); is executed on every page, but OO.ui.Widget is loaded conditionally. So it cannot inherit because the original class doesn't exist yet.

The error only seems to occur on article pages (so when i'm outside of wikitext edit mode).

@TheDJ Does it prevent the gadget from working as expected?

TBolliger renamed this task from OOui undefined error when loading template wizard on en.wp to OOui undefined error when loading template wizard userscript on en.wp on Safari.Apr 10 2018, 9:05 PM
TBolliger closed this task as Declined.
TBolliger triaged this task as Lowest priority.
TBolliger added a subscriber: TBolliger.

Because we'll be discontinuing the gadget for the extension, we won't fix this ticket.

kaldari changed the task status from Resolved to Declined.Apr 10 2018, 10:58 PM

Actually looks like I didn't fix the problem :(

TheDJ changed the task status from Declined to Resolved.Apr 19 2018, 8:46 AM

Fixed:
https://en.wikipedia.org/w/index.php?title=User:Samwilson/TemplateWizard.js&diff=837192002&oldid=835798273

Those class definitions should really be a module on their own at some point, but this will do for now.