Jump to content

User talk:Fred Gandt/userResourceManager.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Errors in this script

[edit]

Hi User:Fred Gandt it looks like there are some errors in this script being logged in our error logging pipeline. Thanks in advance for helping us fix them.

The first error is TypeError: cpg.revisions is undefined The stack trace is: at fetchResources/< https://en.wikipedia.org/w/index.php?title=User:Fred_Gandt/userResourceManager.js&action=raw&ctype=text/javascript:166:13 at success https://en.wikipedia.org/w/index.php?title=User:Fred_Gandt/userResourceManager.js&action=raw&ctype=text/javascript:156:33

Second error is TypeError: eByWN(...) is undefined

at at createUI/< https://en.m.wikipedia.org/w/index.php?title=User:Fred_Gandt/userResourceManager.js&action=raw&ctype=text/javascript:353:10

Third error is TypeError: Cannot read properties of undefined (reading 'appendChild') at at HTMLDocument.<anonymous> https://en.m.wikipedia.org/w/index.php?title=User:Fred_Gandt/userResourceManager.js&action=raw&ctype=text/javascript:353:51

Please let me know if you need further information to debug these. Jdlrobson (talk) 06:19, 1 June 2023 (UTC)[reply]

I will review and fix as soon as I can focus. Rest assured I won't let it persist ignorantly. Thanks for the heads-up. Fred Gandt · talk · contribs 13:49, 1 June 2023 (UTC)[reply]
@Jdlrobson: are errors still being logged, and if so, do you know what skin is being used when those errors are logged? There are only a handful of users and most appear to have no idea what the script is for. Fred Gandt · talk · contribs 02:45, 29 June 2023 (UTC)[reply]
It looks like they are all occurring in the Minerva (mobile) skin.
You might be able to update this code to use mw.util.addPortletLink('p-personal', .. ) - that will work across all skins provided you check the return value is not null! Hope this helps!
TypeError: undefined is not an object (evaluating 'eByWN( "tag", eById( "p-personal" ), "ul", 0 ).appendChild')
stack_trace
at https://en.m.wikipedia.org/w/index.php?title=User:Fred_Gandt/userResourceManager.js&action=raw&ctype=text/javascript:353:51 at mightThrow https://en.m.wikipedia.org/w/load.php?lang=en&modules=jquery&skin=minerva&version=1f12t:49:886 at https://en.m.wikipedia.org/w/load.php?lang=en&modules=jquery&skin=minerva&version=1f12t:50:554

Jdlrobson (talk) 20:23, 29 June 2023 (UTC)[reply]

That helps a lot actually; I figured it was likely a skin issue, partly as I never see an error. The whole script needs a rewrite (it has for *cough* years) so I'll address the errors then. In the meantime, in the next day or so, I'll try and cram a dirty fix in. Sorry for the delay; I'm a bit wobbly 🤷‍♀️ Fred Gandt · talk · contribs 23:29, 29 June 2023 (UTC)[reply]