Hi, welcome to Fandom Developers Wiki! Thanks for your edit to the Talk:ListFiles page.
Re:File Usage Updater
Can you help me?
A couple things. If you want cross browser storage capability, use amplifyjs. Secondly, you shouldn't really be using localStorage.<key> but rather localStorage.getItem(<key>); Best, --Kangaroopowah (Talk) 00:58, September 14, 2013 (UTC)
- Hi, thanks for telling me this. A question about localStorage.getIem() though. How exactly does this optimize the code? Its seems like just another case of using mw.config.get("wgPageName") over wgPageName just because. Sorry to ask, but I've actually searched for the answer to this previously and never found anything regarding it. Thanks! — Foodbandlt (talk) 02:33, September 14, 2013 (UTC)
I was wondering if this could be adapted to use in the main namespace, rather than only File. We have complicated interconnections between our articles (one to many) and need to update links accordingly. I've been using a bot to change the groups of pages affected, but putting it into a que seems a lot better.
- I've never thought about that because people usually use redirects. Is this the kind of edit you're referring to? That wouldn't be too difficult.
Yes, that's exactly right. We categorize our Comics and Images with which exact version of a character appeared in them, so those 'links' need to be updated whenever the character/team/vehicle/item's official page name changes.
I like the first option better, renaming one page at a time and having all of the replacements populate the queue. We don't do batch page renames (yet), mostly because it's rarely needed when it comes to characters. It can happen, of course, but when it does become necessary, we mark all of the pages in the batch to be moved and they all go into a move category. Batch page renaming would be very handy if say, an entire volume of comics changed titles, or an entire television series needed to be renamed, (like here). Even then, the article numbering has to increment accordingly, so batch renaming needs something like a find/replace mechanism or regex.
A usergroup specifically for this function would be ideal. There are few admins who could understand what is happening and how to use it, so we'd want to have control over the group that if we could.
Our character/team/vehicle/item moves are pretty specific, move the page, move the sub-pages, then fix all of the 'links' (often inside single templates like you showed, often a parameter in a template like so). Most, if not all, of that updating can happen based off of 'What Links Here' to the old pagename.
I had discussed with Wikia the possibility of categorizing these appearances by the PAGEID variable, rather than the page name, but it hasn't materialized yet. PAGEID remains a value not easily queried by our templates. It's too bad, because the PAGEID doesn't change for the life of the page, regardless of the page title.
Thanks for your help!
- Cool cool. I like batch renaming, but if you're renaming sequential things so that one page takes the place of another being renamed it gets complicated. Because of the rate of error this presents I actually have this disabled on the File Rename script. The only real purpose of batch renaming is to cut down on the total number of edits made. Instead of making an edit for each page that each item is linked on, it makes all of the needed edits to one page at one time.
- As for limiting it to one use group, that's sort of impossible to achieve with client-side code. Anyone can paste it into their console and get full functionality, spoofing any variables that are required to use the script using breakpoints during runtime to change their value. All you can really do it import it on your personal page so that it's not readily available to use by others who don't know how to use it.
- Are there cases that links to the page would not show up on WhatLinksHere? I can't think of any, but if you know of any it would be helpful. As for replacements on the page, I use regex to check the context that the name is used in to make sure that it's only replacing what it's supposed to.
- Asking for things like using page ids in links would require that Wikia change some core aspects of MediaWiki like the parser, so I can see how they would be hesitant to do that. Lol. I'll start working on this script tomorrow. It shouldn't take more than a day or two. — Foodbandlt (talk) 01:40, April 18, 2014 (UTC)
All right, sorry for the month-long few days. Things started to get busy with exams and work immediately after I started working on it.
I've added a basic version of the script to the Dev wiki for you to try and see if it fits what you had in mind. At the moment it does not automatically rename sub-pages or talk pages, so those would have to be renamed individually. It detects page links and transclusions in all namespaces and updates them (except for the User Blog Comment namespace, the API is bugged for blog comments). It will tell you when a page link is found on a blog comment, though.
There is one thing that I didn't quite understand when I looked back at it: often a parameter in a template like so. Would you mind elaborating a little? All I see is a template with no parameters. If you're talking about renaming the category then there's an additional script that specializes in that, but I wasn't really sure. Thanks! — Foodbandlt (talk) 23:21, May 12, 2014 (UTC)
- No problem! As you can see, my attention to the site can come and go as well with life often getting in the way.
- The seeds you have planted here with this are incredible. This functionality could potentially save administrators from having to learn to code Python to be able to maintain our site.
- I tested it attempting to move Baker (Earth-616) to Baker (Guardsman) (Earth-616) on the Marvel site using my bot account. The page was moved immediately, and I could bring up the que without an issue, but I don't know how long the pages in que stay there (I didn't see any changes in the first ~10 minutes or so. That could just be due to our local setup there, or something got stuck.
- I have two questions:
- Does the user using the tool have to stay on that page until the que is complete?
- Is it possible to leave a redirect behind, or is that the basis for this working?
- To answer your question, I must apologize. I sent you to the category that is created by the template entry, rather than the page the template is on. We basically use parameters (fields) in some of our templates to 'tag' images with who is appearing in them. For instance, for the move in question, The image: File:Baker_(Earth-616).png contains a template with the text 'Baker (Earth-616)' as one of the template field entries (Subject1) link here. Right now I have my Python bot updating those entries as well. It's almost the same thing, just a regex call to find the right configuration.
- Thanks again for all your help!
- Ah, and here's a screenshot of what I was seeing using it:
- It looks like it got stuck at some point. I see that there are links that it did not update (assuming you didn't manually update the two that are updated). I guess now is a good time to be more descriptive in the little status message rather than a static "Processing...", hah. There is one giveaway to the progress in that when it begins submitting pages it adds a small progress bar in between the queue and error box like so. If you didn't see that, then it got stuck somewhere. Large pages take some time to get and submit, but ten minutes is enough time to finish several dozen large pages.
- The rationale behind moving the page before updating the pages it's linked on is because of an update to MediaWiki a while ago which adds the category "Pages with broken links" or something to that effect to pages if it notices a broken link. It's arguable which would be more efficient in terms of where it would stop if something went wrong, but I've found that less people complain about that category when the move happens first.
- Is it possible to leave a redirect behind, or is that the basis for this working? -- Easier than you might think, actually. I can add a checkbox denoting whether to leave one or not if that would better suit your needs.
- Concerning the template parameter part, yes the regex accounts for that looking for either an equal sign or pipe on the left coupled with either a line break or a pipe on the right with optional spaces thrown between most things to account for spacing that people like to use to make templates look prettier.
- The script worked in testing but the majority of bugs are always found outside of testing. I'll have look over and test a few more things like non-alphanum characters and make sure that they're being encoded correctly in URLs and the Regex. While I'm at it I'll make the status message more descriptive of what's actually happening. Sorry about the inconvenience, but thanks for testing it! I'll let you know when I've updated it. — Foodbandlt (talk) 00:21, May 28, 2014 (UTC)
Okay, I'm on localizing this right now. I've noticed a mistake you made while doing this. You ask for translating namespaces into target languages, but what you actually should do, is to allow the use of both English and localized namespaces. For example, you can use both "File:" and "Plik:" for inserting images on Polish wikis, even though only second one is Polish. In fact, any wikicode in English works on non-English wikis. Vengir (talk) 08:45, December 27, 2014 (UTC)
Another problem I've noticed is that it apparently picks the user's language when determining script language. It would be okay if our user's language is the same as wiki's language, but it's not always the case. Ideally, it should use user's language for UI, and wiki's language for critical stuff required to work, such as various namespaces or "Special:Move". Having edit description in wiki's language would also be prefferable (English is probably tolerated globally for this, other languages probably not so much, unless it's also wiki's content language). Less ideal, but probably easier and still alright, would be using wiki's language for the entire extension, including UI. If the user was granted movefile rights, then it's pretty safe to assume he also knows it good enough to use the extension. Vengir (talk) 12:58, December 27, 2014 (UTC)
I were testing various stuff to check if my translations are correct. What I noticed, is that if you manually add to queue an existing file and want to replace it with non-existent one, the original file will be moved anyway. I guess it's kinda logical (who would want to make more redlinks?), but not exactly matching the description in either language. Should we change the description or are you crazy enough to change the code to reflect described action? :P Vengir (talk) 23:11, December 27, 2014 (UTC)
Look at those recent changes on my test wiki. This was only a test, of course, but my intention here was to replace links to "Plik:Adagio Dazzle ID.png" with links to "Plik:Marchewkowowłosa baba.png" without atually moving the file. It replaced links just fine, but also moved the file under a new name, since "New image" didn't exist before that and was viable renaming target. In the end, I'm completely fine with how it works either way, but I'll have to slightly reword the description. Vengir (talk) 23:40, December 27, 2014 (UTC)
Good job, it appears that that bug with moving old file in manual queue add was fixed. And my translation of that description doesn't actually need any update now. I'm not the kind of person who always translates everything literally. If I can find something that sounds more natural, I go for it. That message was the one I took most liberties with, but I also slightly reworded "queueModalWaitConfirm". Vengir (talk) 14:35, December 29, 2014 (UTC)
Re: Localizing help
Hello :) You're welcome ! I'm sorry I couldn't let you know yesterday, I had to leave quickly. —Hulothe 09:54, December 28, 2014 (UTC)
Re: Quick translation request
Hi :) It's done. —Hulothe 16:20, January 21, 2015 (UTC)
PL Done :)
Bug with FileUpdate script
Hi. I'm encountering a bug with the file update script that requires me to have to update file names manually. I can't explain in detail atm, but let me know when you see this and I'll explain in more detail when I have more time to explain fully. :) --SuperSajuuk Talk Page | Tabber Code | Channel 14:48, September 29, 2015 (UTC)
- Hm, that's weird. Requiring you to update manually as in it renames the file, then fails (and alerts you) updating the file name where it's used? — Foodbandlt (talk) 15:53, September 29, 2015 (UTC)
- That's correct. It might be due to the complex infobox coding used to style some infoboxes on the wiki in question.
- This was the edit which I had to perform to update the filenames: http://impressionsgames.wikia.com/wiki/Mansion?diff=6499&oldid=6259
- I suspect it might be because these infoboxes are set up in a rather complex manner, so the script can't find the file name in question. I ensured that I did each separately, rather than using the queue, to update the file names, but it didn't work. --SuperSajuuk Talk Page | Tabber Code | Channel 17:07, September 29, 2015 (UTC)
- Yep, thats the problem. The context that the image is used in in very peculiar. I assune the first part is the inage name and the second part is a caption?
- I'll add this case to the expression. I should have time to push that today, and I'll let you know when I do. — Foodbandlt (talk) 17:35, September 29, 2015 (UTC)
- Yep, that's right. The comma's separate every file name to be added to the infobox, the semi-colon is used for the caption in the gallery.
- In some specific instances, the semi-colon may be used to denote the title on tabber, as the infobox has the ability to choose between whether to tabulate or slideshow the inputted images.
- Thanks for looking into the problem, I'll keep an eye for updates! --SuperSajuuk Talk Page | Tabber Code | Channel 17:48, September 29, 2015 (UTC)
- Just updated it. When the date at the bottom of Special:MovePage changes to today's date, you'll know that you've gotten the update. Try it again (queue or normal rename, doesn't matter) and let me know. — Foodbandlt (talk) 19:39, September 29, 2015 (UTC)
Page AutoUpdate glitches
Recently I was looking for the Page AutoUpdate script, which I've needed on my main wikis to go faster when I and my admins rename pages (and we do that a lot of times). But the script, which I can't use on my main wikis, was tested by my admins, and... it didn't work correctly. First, my admin on Wiki LEGO could use the script twice, and it worked perfectly, but after, it didn't work at all, the script is loading and didn't update anything. However, it renames the page (without leaving a redirect). She also tested it on another wiki, and this time it worked (however the update took a long time, but it worked, at least). I've tried to find a way with talking with several people, include Mime, who told me to contact you.
That's not the only glitch. Also, on my other main wiki, Picsou Wiki, my admin tested also the script and this time it worked, but it made something a bit.. strange. You can see here that it added several times the (personnage) word, but the page was just renamed in Brendon (personnage) and not Brendon (personnage) (personnage) (personnage), like you can see on the edit just at a few places of the page.
So, why do they have those glitches? Can you fix them?
(sorry if my grammar is strange, I'm not a native english speaker)
file usage glitch
Hey. It seems that the script won't update links if the text has encoding things, such as
& instead of &. <3 <3 if you can do a fix that'd be cool. Thanks Food!
Hi! I saw some grammatical errors and a few misleading words in this page and I'd like to contribute with this translation. Would you allow me to edit the page? Thanks in advance for the answer!
Hello. I tried using your code here. The rename part works, but the auto-update one seemingly doesn't (I tried waiting for half an hour, nothing happened). Do you have any idea as to why it doesn't work? Many thanks.--JOA2013:26, August 11, 2018 (UTC)
- That script is unfinished unfortunately. I didn't have time to finish it while I was active and I don't really have time now to finish it. Sorry about that. — Foodbandlt (talk) 05:27, September 5, 2018 (UTC)