MediaWiki talk:Gadget-VisualFileChange.js/Archive/2019

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Help with bulk editing of uploads

Hi,

I used to be a regular contributor on Wikimedia and the English Wikipedia but due to various other commitments my involvement has largely lapsed. I have in the past linked my images to my website www.flagstaffotos.com.au, but unfortunately this website has also lapsed. I am hoping that the VFC tool could be used to help me replace these links to an email instead? I have only rudimentary programming understanding so help would be greatly appreciated!

Many thanks, --Fir0002 www 11:20, 19 February 2019 (UTC)

Update: I think I have worked out how to do this for myself, please disregard --Fir0002 www 11:35, 20 February 2019 (UTC)
This section was archived on a request by: -- User: Perhelion 19:36, 21 February 2019 (UTC)

API request failed (missingparam)

Below the thumbnail: (yes, I am shown those HTML codes)

API request failed (missingparam): At least one of the parameters "text", "appendtext", "prependtext" and "undo" is required. <i>at Thu, 21 Feb 2019 18:38:02 GMT</i> <u>served by mw1224</u>

On the left:

Error: -- NO TASK DESCR. FOR mdGetMetaTable PLEASE ADD IT -- ##### TypeError: Cannot read property 'length' of undefined

This happened for some of the files like File:Cristian Alexis Borja Rio 2016b.jpg from which I was trying to remove the LR request. - Alexis Jazz ping plz 18:41, 21 February 2019 (UTC)

Ran it again on the files it failed, now it worked. Still strange. - Alexis Jazz ping plz 18:45, 21 February 2019 (UTC)
This section was archived on a request by: Speravir 23:08, 2 June 2019 (UTC)

Custom replace not working

Resolved

As of 21:09, 28 May 2019, batch replacing is not working. When one tries to load a category, a message is shown at the left sidebar: Error: An error occurred setting up the selection dialog. ##### ReferenceError: require is not defined Could anybody please fix this? --トトト (talk) 20:25, 27 May 2019 (UTC)

I get the same error. VFC won't load thumbnails. Jcb (talk) 21:18, 27 May 2019 (UTC)
me too, please fix--Vera (talk) 11:00, 28 May 2019 (UTC)
@1Veertje: Commons:Administrators' noticeboard#Batch task not working?
I can't undo that edit. Not sure if you can. - Alexis Jazz ping plz 11:05, 28 May 2019 (UTC)
I can't either. --Vera (talk) 11:08, 28 May 2019 (UTC)
I figured it would take an interface editor, but Krinkle isn't in that user group either. I see Krinkle is a global interface editor though, so that's why. Jean-Frédéric fixed it so VFC is working again. - Alexis Jazz ping plz 11:47, 28 May 2019 (UTC)
This section was archived on a request by: Speravir 23:06, 2 June 2019 (UTC)

Version number and scrit execution on help page

(Continued from COM:AN, cf. later parts of Special:PermaLink/352557466#Batch task not working?)

@Zhuyifei1999: I would not need a version number, as well, but as I said all usages had to be removed then. Apparently, the version number is displayed by transclusion of MediaWiki:VisualFileChange.js/versionBox (which itself is transcluding MediaWiki:VisualFileChange.js/version). So, outside of the script we’d need to remove the usages according to this search. Most of these are translated pages of the help, though, which have to be dealt by a translation admin I think. Afterwards both version(Box) pages could be deleted in my opinion. I could remove the transclusions from all pages but the translated versions. Also, I cannot delete both Mediawiki sub pages.

As said before, your change produces an error on the help page. The script remindErrorMessages makes errors visible by adding a box to the top and showing the error(s) in place. A lot of errors are hidden by default and only shown in submit mode. (As example you will in Template:Error easily see 7 errors on the page. With the script you will get 8 errors and a box on top pointing to these; the 8th error is in the {{1}} itself which probably is overlooked by default.) Alas, in this very case I only get the hint <span class="error">Error:</span> (edited) without any text/explanation, so I am sorry that I cannot tell you anything about this error beyond its existance. — Speravir – 00:21, 3 June 2019 (UTC)

(Edit, no not anymore:) Of course, the script now adds a box on top of this page because of my addition above. And it also notices me only about the error, because there is no more explanation given by me … — Speravir – 00:24, 3 June 2019 (UTC)
I see; remindErrorMessages indeed gives me 5 error messages on Template:Error and 1 "error" message here. However, it does not show any error messages on Help:VisualFileChange.js. Can you show me the full HTML contents of that page, redacting any sensitive information?
Regarding the version string; I guess I'll use the "if it ain't broke, don't fix it" approach right now, considering that it's still somewhat used within the code and I'll have to figure out how to remove all usages --Zhuyifei1999 (talk) 02:27, 3 June 2019 (UTC)
Before I upload: I guess I should remove the several tokens I see in source code? JFYI I deactivated my global.js and common.js, then reloaded without cache, but this did not help. That’s nonsense, it still must have been in cache, because the visible error is by a script itself, the script we talk about here. — Speravir – 01:50, 6 June 2019 (UTC)
Another thing I noticed: The sidebar on the left is wider in VFC than in the undelying page which leads to some hidden parts (e.g. the hint to convert to regex). — Speravir – 20:54, 4 June 2019 (UTC)
Yes please remove the tokens --Zhuyifei1999 (talk) 22:19, 4 June 2019 (UTC)
OK, see [https://pastebin.com/yYRAu2ZF VFC-Test]. (Edit: Deleted, link is dead.) I intend to delete this again when you tell me you don’t need this anymore. Note that I used this old version of Commons’ sandbox page, because I thought it should create a shorter source. — Speravir – 01:50, 6 June 2019 (UTC)
Ah, I see what is going on. VFC uses a hidden <div style="margin-top: 50px; padding: 10px; display:none" class="error">Error:<div> placeholder for VFC error messages in case any occurs, and it says hidden until it actually occurs. However, having this 'class="error"' makes remindErrorMessages think it is actually an error message when it is in reality just a placeholder, so this is a false alert. For a 'workaround' I guess we could either switch to a different class or defer adding the class until an error occurs; don't know it if it'll worth though.
Also I originally didn't understand that the message appear after clicking the button; I thought you meant the message is shown on the page before the button is clicked. That's why I didn't see it --Zhuyifei1999 (talk) 06:25, 6 June 2019 (UTC)
THX, Zhuyifei. So, I can remove the file again, right? When started as a gadget this does not happen, though. In other words: Let it as it is.
It would be good, though, if you’d figured out why the sidebar in VFC is too wide, wider than in Monobook and Vector skin which, as written above, leads to hidden content. It is somewhere in VFC set to a width of 250px. Unfortunately one cannot overwrite this with user CSS, because there is no id for the div element of the sidebar (or if defined this would have an effect at unintended places). — Speravir – 00:01, 7 June 2019 (UTC)— Speravir – 00:01, 7 June 2019 (UTC)
The reason starting as gadget does not trigger is likely because the gadget link is pressed after remindErrorMessages loads, which doesn't keep rechecking the page for hidden 'error messages'. Loading it with the link makes VFS load before remindErrorMessages.
How the sidebar size is defined is in MediaWiki:Gadget-VisualFileChange.js/core.js, function ProgressBox. It has a default of 250 unless provided by function parameter. However, that parameter is never defined.... Shall I add a div id to id so you can do it with CSS? --Zhuyifei1999 (talk) 18:52, 7 June 2019 (UTC)
The loading order as reason for not showing the error sounds valid. And adding an id would be fine, but I actually wonder why noone other complains about this. — Speravir – 22:17, 7 June 2019 (UTC)— Speravir – 22:17, 7 June 2019 (UTC)
Because I don't see anything hidden? Anyways, adding id. --Zhuyifei1999 (talk) 23:18, 7 June 2019 (UTC)
Special:Diff/353523698 --Zhuyifei1999 (talk) 23:21, 7 June 2019 (UTC)
Thank you. I consider it resolved now for me. — Speravir – 00:21, 9 June 2019 (UTC)

Unfortunately adding #vfc-progressbox { width: 170px !important; } does not solve the issue with hidden content – I speak of the light green regex switch here. I thought it was hidden because of the broad sidebar, but this is apparently not the case. There must be another reason. :-(. — Speravir – 01:28, 9 June 2019 (UTC)

Fixed that Special:Diff/353655405 --Zhuyifei1999 (talk) 01:56, 9 June 2019 (UTC)
Wow! Then now this thread can be closed. Sorry for my erroneous idea it should have been caused by the sidebar. Nonetheless I will use the new id to make the top title string locally a bit smaller. — Speravir – 03:41, 9 June 2019 (UTC)
This section was archived on a request by: Speravir 03:41, 9 June 2019 (UTC)

Custom replace stopped working

Since about a weak there is something wrong with custom replace option. I'm doing everything correctly but after clicking execute nothing happens, see screenshot. ~Cybularny Speak? 23:14, 2 March 2019 (UTC)

Cybularny: I believe the yellow frame and yellow check mark means those files did not match the pattern you entered on the left. In your screenshot, that pattern ends with a newline character (\n), which may not be there if the {{uncategorized}} tag is the last thing on the page. Maybe that's the issue? LX (talk, contribs) 10:00, 3 March 2019 (UTC)
The \n is a new line, try to replace \n with (|\n). --Steinsplitter (talk) 10:19, 3 March 2019 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Roy17 (talk) 15:16, 21 June 2019 (UTC)

Not displaying some PNG properly

  1. File:Singapore.png
  2. File:Singapore-Sentosa.png
  3. File:Singapore-Riverside.png

Try use it for search query of svg singapore. These three PNG appear blank and have a size of 0?--Roy17 (talk) 13:21, 31 July 2019 (UTC)

Cannot reproduce, probably resolved.--Roy17 (talk) 15:40, 20 December 2022 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. --Roy17 (talk) 15:40, 20 December 2022 (UTC)

Can't Figure Out How to Change Previous Contributions

Screenshot of VisualFileChange not showing the new search query option yet

This may be my lack of understanding. I recently changed my username and am trying to update my contributions to the new name. I used VisualFileChange.js to change what it listed (which worked great. Thank you!), but it didn't list all my contributions. For reasons I have never understood my contributions are in two groups. Things uploaded on or before September 10, 2014 & things uploaded after. The utility recognizes the things in the later group but seems to be unaware of the earlier group. This doesn't seem like a bug, rather an inadequacy. Jim Evans (talk) 22:47, 24 December 2019 (UTC)

@Jim Evans: you dont have any contribution on Commons before May 2015 [1] [2]. Not much uploads on enwp either [3]. Are you referring to another account?--Roy17 (talk) 22:58, 24 December 2019 (UTC)
You need to use VFC on this account User talk:Wiki name~commonswiki.--Roy17 (talk) 23:01, 24 December 2019 (UTC)
@Jim Evans: since you are only changing your sig, it's even easier to use VFC in search query mode and type insource:/\[\[User\:Wiki.name\|i\_am\_jim\]\]/ . 121 files are found at the moment.--Roy17 (talk) 23:08, 24 December 2019 (UTC)
You are incorrect. About a week ago I had my username (not an account) changed from Wiki name to Jim Evans. Juat a few hours ago I used VisualFileChange to change my name from Wiki name (my previous username) to Jim Evans (my new/current username} on all my contributions since September 10, 2014. Only the name has changed all contributions before September 10, 2014 were done under the same account and by the same person, me. Jim Evans (talk) 00:19, 25 December 2019 (UTC)
I'm unable to find where I should put the code you quoted. I am using the utility in the mode called "Try before installing" and so far I cannot find a Search Query mode. Jim Evans (talk) 02:08, 25 December 2019 (UTC)
In the initial dialogue, instead of user name, select search query from the list. -- Rillke(q?) 23:21, 15 March 2020 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. --Roy17 (talk) 15:40, 20 December 2022 (UTC)