User talk:SD0001/RFUD-helper.js

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

Bug due to new Subscribe button[edit]

Hey, SD0001, I've found a bug in this script due to the introduction of the [Subscribe] link in section headers. The selector that populates the section name grabs the text "Subscribe" from that button, rather than the actual header, resulting in edit summaries like this and log entries like this (note the section target in the wikilink for "request". The issue is on lines 60-62, where the sectionName variable is set, which uses:

header_element.firstChild.textContent

....and now picks up the "Subscribe" element rather than the header. Here's a possible fix:

rfud.sectionName = $(header_element).children(".mw-headline").text()

(or, alternately, move that line below line 64, and then you can do:

rfud.sectionName = rfud.$header_element.children(".mw-headline").text()

...to save on wrapping with a jQuery object twice. You can see the diff here. I've run it through a debugger, and it seems to pick up the section title correctly, but I'll note that I haven't tested it thoroughly.

Thanks. Writ Keeper  00:19, 4 December 2022 (UTC)[reply]

Hi Writ Keeper, I've been informed about the bug but haven't had the time to look into it. I'm on vacation at the moment so please feel free to fix it in the script. – SD0001 (talk) 04:40, 4 December 2022 (UTC)[reply]
Got it, fix implemented. Seems to be working so far, but I'll keep an eye on it. Thanks again, and I hope you enjoy your vacation! Writ Keeper  05:05, 4 December 2022 (UTC)[reply]