User talk:BrandonXLF/ReferenceExpander

Implementation options
Is this also a gadget in preferences?

Is there a form somewhere for this? I want to paste a Wikipedia article name in it and test it. Similar to how reFill works: --Timeshifter (talk) 16:29, 5 February 2021 (UTC)
 * https://refill.toolforge.org/ng

Suggestion
Could the script be coded to remove if their is no expandsion errors?Leomk0403 (Don't shout here,  Shout here!)  07:15, 10 January 2022 (UTC)

tool created junk cs1|2 templates
At this edit the tool put a url in title which it should never do. And, the url in title is different from the url in url and both of those urls are different from the original url. Which is the correct url? The original, which, despite the tag, is not dead. It does however, redirect to a new url so that new url is the url that the tool should have used in url.

In cs1|2, urls are only allowed in the url-holding parameters archive-url, article-url, chapter-url, conference-url, contribution-url, entry-url, map-url, section-url, transcript-url, and url; the insource locator parameters at, page, pages, quote-page, and quote-pages; and id. A url appearing in any other cs1|2 parameter is an error so the tool should never put a url in any parameter except those for which a url is expected.

Please fix the tool.

—Trappist the monk (talk) 13:27, 6 September 2022 (UTC)
 * That's an issue with Zotero, which is what generates citation information for Citoid (which is used by this tool as well as by VisualEditor). I could add a check to make sure the title is not an external link when filling in the title parameter with the information from Zotero. Are there any other similar checks I should add? Since this issue also effects VisualEditor, it might be better to actually resolve the issue with Zotero or to at least create a Phabricator task for the issue. – Brandon XLF  (talk) 20:35, 6 September 2022 (UTC)
 * I reported a similar, maybe it's the same, issue at phabricator for ve creating twitter cites that duplicate the tweet's url in both url and title. That was in June.  The report has been shuffled off into a dusty corner so that it can be ignored (like so many other reports);.
 * Given that such reports will not be addressed any time soon, I think it would be best for this tool to catch urls in what should be a plain-text title. I don't know what the tool should do when it finds such malformed 'titles' because, to me, whatever remains after a url is stripped from whatever Zotero gave you is suspect and may not actually hold the source's title.  Any 'title' with pipe characters (or any of the html vertical bar character entities) may have the source title but those pipes indicate that there is other stuff there – often the website name which does not belong in title.  So I guess my gut reaction when a url or a pipe is found in the 'title', is to abandon the edit and let a human fix it.  Of course, the next fix attempt will probably be by reFill which, by itself, has damaged more cs1|2 templates than any other 'tool' in the arsenal.
 * Yeah, I know, not your fault. I just grow so weary of fixing stuff that was caused by tools that the operating editor accepted as a 'good fix' because the 'tool did it, so it must be right else the tool wouldn't be there for us to use...'
 * I don't have any other particular issues that you might fix but it does occur to me that you might want to troll Wikipedia talk:reFill and its archives to make sure your tool doesn't do any of the bad things that that 'tool' does.
 * I'll shut up now. Thanks for letting rant.
 * —Trappist the monk (talk) 21:45, 6 September 2022 (UTC)
 * I don't have any other particular issues that you might fix but it does occur to me that you might want to troll Wikipedia talk:reFill and its archives to make sure your tool doesn't do any of the bad things that that 'tool' does.
 * I'll shut up now. Thanks for letting rant.
 * —Trappist the monk (talk) 21:45, 6 September 2022 (UTC)
 * —Trappist the monk (talk) 21:45, 6 September 2022 (UTC)

Info needs "It remains the responsibility of the editor to verify that the expanded references are correct."
The documentation needs to say prominently "It remains the responsibility of the editor to verify that the expanded references are correct" or words to that effect. Best wishes, Pol098 (talk) 16:16, 11 February 2023 (UTC)


 * I added a new review page to the script that shows a disclaimer. – Brandon XLF  (talk) 23:36, 12 February 2023 (UTC)
 * User:Philoserf (contributions) has been using this tool extensively with edit summaries "expanding bare references", and a very significant proportion of the edits end up removing information from articles. For example, replacing several citations in the same footnote with a single citation, removing quotations, removing translated titles, removing URLs, removing explanatory text that puts the citation in context, and so on. I don’t have the time to check through hundreds (thousands?) of potentially destructive semi-automated edits, and it doesn’t look like anyone else is bothering to check. Can you please fix the script and/or heavily discourage its careless use? Thanks. –jacobolus (t) 17:18, 30 March 2023 (UTC)
 * @Jacobolus I made the notice discouraging accepting the new references without adding back the information included with the old references more prominent, hopefully that helps. – Brandon XLF  (talk) 23:20, 1 April 2023 (UTC)
 * Thanks. Per the query result at User:XOR'easter/sandbox/ReferenceExpander there are apparently 2000+ edits from this calendar year (no idea about previous years) that need to be checked; I am guessing at least several hundred will need to be reverted or manually fixed to avoid data loss, and in most cases there have been subsequent edits afterwards, so it will take some care and patience to not make further mistakes. It’s going to take many hours of work for someone to clean up. –jacobolus (t) 19:27, 6 April 2023 (UTC)
 * I've been looking and working through the citations broken by careless use of your tool as well (there was just a reminder post at AN about Philoserf's misusage), and while it's good you have a discouragement for users not to replace poorly formatted references with well-formatted but strictly worse ones, I think your script should have more robust behaviour when its input is something more than just a bare url or something. If it's not clear the output incorporates all the information present in the input, maybe your script should not propose changes at all. At absolute minimum, I would think that if the input contains a cite template within ref tags, anything else inside the ref tags but outside the cite template should be passed unaltered to the output. Folly Mox (talk) 13:40, 19 May 2023 (UTC)

Script added a .local non-working URL
I'm not sure what happened here? Ed [talk] [majestic titan] 18:01, 10 March 2023 (UTC)