User talk:Evad37/SPS.js

Global deliver
I don't think is true. I've seen no evidence that global messages have gone out through this script. Please advise. Chris Troutman ( talk ) 16:31, 24 May 2018 (UTC)
 * Nevermind. It's not an issue with the script, it's an issue with global mass message. Chris Troutman  ( talk ) 16:35, 24 May 2018 (UTC)

Snag
There's a problem with the script: it moved all but one of the pieces and I stopped publication rather than continue into a further mistake. I've moved the missing article and am proceeding with publication manually. Chris Troutman ( talk ) 23:21, 29 June 2018 (UTC)
 * I noticed that. Feel free to grab the code I put on the Newsroom if you need to manually create the contents page. Right now I'll patch it up and put a new version on a subpage in my userspace for you. ☆ Bri (talk) 23:22, 29 June 2018 (UTC)
 * Chris, if you need it: User:Bri/Signpost2018-06-29 contents can just overwrite Wikipedia Signpost. The single-page contents page is a one liner, so I just went ahead and created it. ☆ Bri (talk) 23:35, 29 June 2018 (UTC)
 * It looks like exactly the same code should be copied to Wikipedia Signpost/Archives/2018-06-29, too. ☆ Bri (talk) 00:03, 30 June 2018 (UTC)
 * The problem was that we had too much content – the script tries to do all the page moves at once, which is normally okay, but this issue had 17 pages to be moved, and the limit for page movers is 16 per minute. I'll work on fixing this for the next issue. (Chris, in case you missed it, the manual instructions and auto-generated outputs got moved to the bottom of Wikipedia Signpost/Newsroom/Resources) - Evad37 &#91;talk] 02:43, 30 June 2018 (UTC)
 * Oof, that's the second time we have broken something with too many notes. Still a problem I'd prefer over running out of content. ☆ Bri (talk) 02:49, 30 June 2018 (UTC)
 * , Good morning everyone. I'm  sorry  to hear there were some last  minute hitches with  the script -  nothing  I  could help with from  my  deep  slumber though. Well  done for  getting  the magazine out. Could someone give a nudge to  whoever does the watchlist  notice with  our  standard message?" Thanks. Kudpung กุดผึ้ง (talk) 03:10, 30 June 2018 (UTC)
 * Done. Chris Troutman  ( talk ) 03:16, 30 June 2018 (UTC)

Publishing script error

 * Moved from Wikipedia talk:Wikipedia Signpost/2019-03-31/In focus. Headbomb {t · c · p · b} 23:09, 31 March 2019 (UTC)

BTW, this was fixed in this edit, which started using extraJs.parseTemplates to properly parse templates which might contain other templates. - Evad37 &#91;talk] 23:43, 30 April 2019 (UTC)
 * I think the text is not complete, it starts with an incomplete sentence anyway. You might like to check this, please.--Aschmidt (talk) 15:37, 31 March 2019 (UTC)
 * I think the script did this at Special:Diff/890305353. Could you please take a look at this? —  Newslinger  talk   15:42, 31 March 2019 (UTC)
 * ✅. the script assumed that the earliest set of   was the end of the description template, but it wasn't. Maybe add a sanity check that there were no other   before it? --DannyS712 (talk) 15:45, 31 March 2019 (UTC)
 * Yeah, the script was expecting plain text (or no text) for the RSS description, not wikitext. Let's continue discussion on the script talkpage. - Evad37 &#91;talk] 22:54, 31 March 2019 (UTC)

Possible script error
I noticed that script-assisted publishing for this most recent 30 April Signpost edition added duplicate discussion templates to the bottoms of some (but not all) of the articles. I've removed duplicate comment section templates from:, , , , , , ,. Edits like this appear to have added the extra comment box. I'm not sure what the cause is or if I'm missing something, but I just wanted to give a heads up. Airplaneman  ✈  20:10, 30 April 2019 (UTC)
 * Thanks for your intervention; yes, I had noticed that. We have more than one editor making interface changes and as always, some crossed lines occurred. Chris Troutman  ( talk ) 20:12, 30 April 2019 (UTC)
 * On the other hand, I believe that my change to the publishing script to automatically request watchlist notifications worked like a charm - did you see any errors? --DannyS712 (talk) 20:23, 30 April 2019 (UTC)
 * Yeah, I missed that this template move happened, which is why it only affected some of the articles – those using the old (redirected) template name worked fine. Will be fixed for the next issue. - Evad37 &#91;talk] 23:39, 30 April 2019 (UTC)

Error
While trying to publish, I got as far as moving the "next issue" pages into the WP namespace and hit "(API error: internal_api_error_DBQueryError)". I'll be proceeding manually. Chris Troutman ( talk ) 00:39, 31 May 2019 (UTC)
 * Sorry to hear that. The only thing I can guess is the last edit I did to the Recent Research article, which got rid of the "Unexpected < operator" error message (like last month). I wish I could help more but I'm clueless.  Thanks for your efforts. Smallbones( smalltalk ) 00:44, 31 May 2019 (UTC)


 * The internal api error means the problem was on the MediaWiki software side of things, possibly T223175 or similar. That error only came up 29 times over a few weeks (across multiple wikis) according to the bug report, so maybe you were just unlucky? - Evad37 &#91;talk] 03:51, 28 June 2019 (UTC)

Updating script
In its most recent use to publish the Signpost the template pp-semi-indef was removed, the script should be updated to include it. The Editor's Apprentice (talk) 03:18, 31 August 2019 (UTC)

Adding a wrapper div to the main page
Could we make a tweak to the script to restore this edit in future runs? The class helps when targeting the signpost page with userstyles. It looks like we'd only need to modify topwikitext and bottomwikitext (L677 and L680 respectively) to do this. Also the same would be needed for the section above this one. — AfroThundr (u · t · c) 02:33, 25 January 2020 (UTC)
 * I've created Wikipedia Signpost/Templates/Main page top and Wikipedia Signpost/Templates/Main page bottom, which can be subst'ed by the script. This way the community can make changes via (something approximating) the normal editing process, rather requiring script updates. - Evad37 &#91;talk] 04:10, 25 January 2020 (UTC)
 * Thanks a bunch! { — AfroThundr (u · t · c) 04:17, 25 January 2020 (UTC)
 * ✅. Pinging as a notification that this has happened. It's a relatively minor change to the script, and I tested it here and at the newsroom with the script in dry-run mode. - Evad37 &#91;talk] 05:07, 25 January 2020 (UTC)

I had some extra time
I had some extra time, and took a look through the code for this (looking for any techniques I didn't know) and wanted to do some minor cleanup. Would you mind looking at these changes? Since this is an onwiki script, I can't submit a pull request, but what it does is And other such tweaks. There should be no resulting change to the code running. I ran it in dry mode, and everything worked. Thanks, --DannyS712 (talk) 05:37, 25 January 2020 (UTC) yes, but I checked every caller, and all provide a string (i.e. the null part could be removed entirely) --DannyS712 (talk) 06:05, 25 January 2020 (UTC)
 * Remove trailing whitespace
 * Replace calls to postWithToken( 'csrf', ... ) with just postWithEditToken
 * Remove unneeded joins for multiple values for api calls
 * Fix a typo  ->
 * At first glance it looks mostly fine, except for changing the  to  . The loose comparison matches both  and  (ie when second parameter isn't passed), whereas the strict comparison only matches . e.g. the following   logs   - Evad37 &#91;talk] 05:56, 25 January 2020 (UTC)
 * Actually, that function and the  function are duplicating code from extraJs. It's quite close to publication time now, so I'll wait till after to update the script. - Evad37 &#91;talk] 10:48, 26 January 2020 (UTC)
 * I found some more things to update DannyS712 (talk) 02:47, 27 January 2020 (UTC)
 * Okay. https://en.wikipedia.org/wiki/Special:ComparePages?rev1=937459621&rev2=937778355&diffmode=source includes

It still shouldn't affect the result, with the exception of the addition of sudo. Thanks, --DannyS712 (talk) 04:46, 27 January 2020 (UTC)
 * Remove trailing whitespace
 * Replace calls to postWithToken( 'csrf', ... ) with just postWithEditToken
 * Remove unneeded joins for multiple values for api calls
 * Fix a typo  ->
 * Use consistent spacing of,  ,
 * Adds an edit protected template for the request to bump the watchlist message (sudo)
 * Tweaks indentation to be more clear and consistent
 * Remove  in favor of
 * ✅, thanks Danny - Evad37 &#91;talk] 09:49, 27 January 2020 (UTC)

Change request
I ran through the script a bunch of times in dry mode in preparation for being the publication manager this month, and noticed that for the main page wikitext preview (and rendered preview) the links to everything but the first article are wrong. Looking at the wikitext, I see that there are a bunch of  instances which, while correct for the actual edit, render the preview wrong - the first instance is replaced by the code but this does not replace *all* of the occurrences, just the first. Would it be possible to switch this to replace them all? Thanks, --DannyS712 (talk) 20:16, 28 March 2021 (UTC)
 * That code was actually just meant for correcting the header, since the visual preview isn't affected much by the other uses (just means some of the story links will be blue links instead of redlinks). But this doesn't work anymore, since the header is now subst'ed from Wikipedia Signpost/Templates/Main page top instead of coming from a string directly in the script. While it's pretty easy to do the global replace you suggest by changing the third line to  that won't change the instance that comes from the subst'd header. - Evad37 &#91;talk] 00:53, 29 March 2021 (UTC)
 * with a little help from a new Lua module Module:Wikipedia Signpost/Main page top preview - Evad37 &#91;talk] 01:49, 29 March 2021 (UTC)

Extra step request - automatically request protection for list of stories
Eg for the page Wikipedia Signpost/2021-09-26 - this gets transcluded in the mass message, and eventually the bot comes and protects it as widely transcluded (last month Special:PageHistory/Wikipedia:Wikipedia Signpost/2021-08-29) but the faster the better. DannyS712 (talk) 20:57, 26 September 2021 (UTC)

Problem if the page includes the word "null"
Just ran across what appears to be a bug:. The word "nullified" was changed to "ified" as the script did its thing. GorillaWarfare (she/her • talk) 22:25, 30 January 2022 (UTC)


 * I suspect the fault is in these two statements, introduced in Special:Diff/892576225:
 * The null is implicitly turned into the string "null" and then used as the needle for the find-and-replace operation. Krinkle (talk) 02:41, 31 January 2022 (UTC)
 * The null is implicitly turned into the string "null" and then used as the needle for the find-and-replace operation. Krinkle (talk) 02:41, 31 January 2022 (UTC)
 * The null is implicitly turned into the string "null" and then used as the needle for the find-and-replace operation. Krinkle (talk) 02:41, 31 January 2022 (UTC)

RUH ROH!!!!! I am just seeing this now. I guess that is a problem because I am now the only one who maintains this darn script... jp×g 11:50, 22 December 2022 (UTC)

massmsg: two issues
@JPxG (and other page watchers), I have a note for the future and what appears to be a bug to report with the current implementation.


 * 1) Right now,   at the end of the message definition puts the bullets on the same line as the div surrounding them. This causes them to fail to display correctly as a list; see . This is the bug. (Should be trivially fixable without consideration for item 2.)
 * 2)   will Sooner rather than Later be in TemplateStyles rather than in Common.css (see MediaWiki talk:Common.css/to do and section Hlist). That means   will instead need to use one of the templates that will provide the class and styles. In this context, either flatlist or hlist will be sufficient. The use of hlist will also make item 1 simple to implement, separate to a fix for item 1.

Izno (talk) 05:34, 22 December 2022 (UTC)