FANDOM


This is the talk page for discussing improvements to the MassNullEdit page.

Where is my tool bar ?

Where is my-tools bar ? when I execute the script, it says me that the button was not created because it doesn't find "#my-tools-menu". Can anyone help me ? PS : I am on oasis. Gguigui1 (talk) 15:11, August 26, 2014 (UTC)

My Tools should be beside Follow and Customize on the Wikia Bar. I haven't encountered your error so far, so it may be clashing with a script that you have in your global.js. You could maybe try using AjaxBatchDelete and see if it also produces the same error? I'm also using Oasis, by the way. Lia (wall) 16:02, August 26, 2014 (UTC)
Oh, I see it, it's the +, but it's not my-tools-menu, it's ul.tools-menu. With this selector, I have no error and I see it.
I don't think it's that. I think it's the eventlistener because I don't have this error in AjaxBatchDelete. If the button is not created, the eventlistener will crashed the script. You should replace it by a function click function. Gguigui1 (talk) 16:23, August 26, 2014 (UTC)
Ozuzanna (the author of the script) will still most likely add more updates since the script is still pretty new. Although, it's odd because I did not get any error notifs since I started using this script. Good to know it works fine for you now! Lia (wall) 17:51, August 26, 2014 (UTC)
Hi, I am using Oasis and I have no issues loading the script. I have used the event listener instead of click() with assigning a href # to mitigate the side effect of scrolling to the top of the page whenever it's clicked (as well as collapsing the elements in recent changes). I am not sure why the button would not load for you in the first place though, since if that isn't created, then you can't open the modal. It's also proper convention than using a href attribute of "javascript:void(0)" as well. From this feedback I've added that for Oasis you must not have the toolbar hidden or it will fail to work. If you encounter any more issues, please let me know. – Ozuzanna 13:09, August 27, 2014 (UTC)

Hi, I think I found the issue. The problem is the document.getElementById('t-mne'). As the selector was wrong, the button was not created, the document.getElementByUd was null and the script crashed. You should test the exist of the button before make a event listener. PS : The button appears for me even when the wikia bar is hidden. Gguigui1 (talk) 13:52, August 27, 2014 (UTC)

I undid your edit and it seemed to have restored the functionality, for me anyway. Does this fix your problem? If not, could you please inspect element the "My Tools" and tell me what class/id it is? – Ozuzanna 14:11, August 27, 2014 (UTC)
No, the problem was fixed with my edit but now, the error is still here. The class I have is "tools-menu", "ul.tools-menu". Gguigui1 (talk) 14:24, August 27, 2014 (UTC)
Okay, are you using Oasis in a language that is not English? Also, could you provide me with a screenshot of what your tools menu looks like? – Ozuzanna 14:37, August 27, 2014 (UTC)
Update: I have pushed an experimental fix to the script, it should work for both of us. Let me know if it fixes. – Ozuzanna 14:44, August 27, 2014 (UTC)
Yes, I use the French version and my wikia bar looks like
Taskbar
.
PS : I have the same error, have you try with .tools-menu only ? Gguigui1 (talk) 17:04, August 27, 2014 (UTC)
Okay, so the problem lies where that you have a different element layout than me compared to English Oasis. The selectors are different, so we should use both selectors in the jQuery. I will try .tools-menu now. – Ozuzanna 17:10, August 27, 2014 (UTC)
If this doesn't work, then I will go into Fr Oasis myself and find where to put the element depending on the language set. – Ozuzanna 17:12, August 27, 2014 (UTC)
Update: Here's the hopeful fix - the code that worked for you I have put for users who have their language set as French, and if they do not have it set as French then it will do the code that worked for English users. – Ozuzanna 17:24, August 27, 2014 (UTC)
I just found out that in French your button will appear here like this under "Mes outils". You need to have that not hidden. That's how this script was intended to be used. – Ozuzanna 17:47, August 27, 2014 (UTC)
Oh, I reset my tools and I see my tools now. Thank you for your help. I don't know why I don't see it before. Gguigui1 (talk) 07:27, August 28, 2014 (UTC)

Suggestion: auto-populate list

The majority of the times I want to MassNullEdit, it's due to a template change, so it would probably save time for most people if MassNullEdit auto-populated the list when it is launched on Special:WhatLinksHere, or a category.

$('#mw-whatlinkshere-list a').each(function (){ 
   link = $(this).prop("href"); 
   page = $(this).text(); 
   if (page == '← links' || link.indexOf("/Thread") != -1 || link.indexOf("/Message_Wall") != -1 ) return;
   $('#text-null-edit').append(page+"\n"); 
});

(and the same thing with $("#mw-pages a") for categories.)
I've excluded links to Threads and Message Walls, Board_Thread and other namespaces may also need to be excluded. -452 (talk) 19:28, August 30, 2014 (UTC)

That's actually a pretty good idea. I'll implement it to do that. Thanks! – Ozuzanna 22:04, August 31, 2014 (UTC)
Done - I've also added support for image links. They'll be added automatically too. If you can figure out how to add subcategories too, feel free to (or request here with the code) as I had a little trouble figuring how. – Ozuzanna 22:17, August 31, 2014 (UTC)
Minor problem: Subcategories are having the first 6 characters removed by ".substring(6)". I think you meant for this to remove "/File:" - but to purge file pages, you need the "File:" to be there. So changing the "6" to "1" should fix both issues. -452 (talk) 01:40, September 5, 2014 (UTC)
Odd - it works fine for me (see here and here). The 6 characters to remove are actually "/wiki/" as I'm using the href attribute to get the page names, since long names will have their text not fully displayed at times thus making the href more reliable. Is this not working for you - and if yes, could you please show me a screenshot? – Ozuzanna 10:26, September 5, 2014 (UTC)
Ah of course: not all Wikia wikis have /wiki/ - This isn't an issue often, but I probably should have realised this time, as I fixed another /wiki/ related issue just yesterday.
One solution: Compare the first 6 characters before removing them.
Alt solution: Get the file/category name via the "title" attribute instead of "href".
-452 (talk) 13:28, September 5, 2014 (UTC)
Oh yeah, I forgot not all wikis are /wiki/. I've made it so the images are grabbed through the title attribute and categories through text. – Ozuzanna 14:49, September 5, 2014 (UTC)

Hey! Just a little suggestion/fix for this feature. It doesn't work well with non-English wikis and even non-en interface. So here's a fixed code

   //Autocomplete support for [[Special:WhatLinksHere]]
      if (mw.config.get('wgCanonicalSpecialPageName') === "Whatlinkshere") {
         var thread =  '/'+mw.util.wikiUrlencode(wgFormattedNamespaces[1201])+':', // "/Thread:" in wiki lang
             wall =  '/'+mw.util.wikiUrlencode(wgFormattedNamespaces[1200])+':', // "/Message_wall:" in wiki lang
             board =  '/'+mw.util.wikiUrlencode(wgFormattedNamespaces[2000])+':', // "/Board:" in wiki lang
             special =  '/'+mw.util.wikiUrlencode(wgFormattedNamespaces[-1])+':'; // "/Special:" in wiki lang
         $('#mw-whatlinkshere-list a').each(function (){
            link = $(this).prop("href"); 
            page = $(this).text(); 
            if (link.indexOf(special) != -1 || link.indexOf('action=edit') != -1 || link.indexOf(thread) != -1 || link.indexOf(wall) != -1  || link.indexOf(board) != -1 ) return;
            $('#text-null-edit').append(page+"\n");
         });
      }

Now it'll grab translated namespaces (I added Board ns too) to check them against the link. And instead of checking for "← links" and "edit" it'll also match it against the URL. — Nanaki @fandom 13:05, April 3, 2016 (UTC)

Hey, I'm busy right now and can't really analyze your code, feel free to add it to the script if you're certain it will work as intended. – Ozuzanna 20:03, April 4, 2016 (UTC)
I checked it on multiple wikis before posting it here :) Added the change and sent for review. — Nanaki @fandom 10:22, April 5, 2016 (UTC)

Suggestion: Display errors at end

Currently, each error is shown one-by-one in a pop-up. If there are a lot of errors, for whatever reason, it means a lot of clicks. It also means that if you press "initiate" and walk away, any error means the rest of the list won't be done until you get back and dismiss the message.

Solution: Display errors in the console alongside the success messages, store them in a variable, and show a single popup with all failed pages at the end - which can then be copy/pasted right back into the textarea, or, perhaps simply dump the list of failed pages directly into the textarea, and have the popup state that this has occurred. -452 (talk) 13:44, October 24, 2014 (UTC) (typo fixed 13:55, October 27, 2014 (UTC))

Added. – Ozuzanna 17:30, October 24, 2014 (UTC)
Thanks, however this implementation adds "Failed to null edit PAGENAME: unknownerror" to the error box, which is not convenient for copy/pasting back into the textarea. -452 (talk) 13:55, October 27, 2014 (UTC)

Mass failures

Test results of purging 1211 pages:

  1. 1154 fail. 57 succeed.
  2. 1130 fail. 23 succeed.
  3. 1047 fail. 83 succeed.
  4. 1020 fail. 27 succeed.
  5. 993 fail. 27 succeed.
  6. 498 fail. 495 succeed. (Focused on other tabs)
  7. 439 fail. 59 succeed.
  8. 249 fail. 190 succeed. (Focused on other tabs)
  9. 162 fail. 87 succeed. (Focused on other tabs)
  10. 150 fail. 12 succeed.
  11. 140 fail. 10 succeed.
  12. 129 fail. 11 succeed.
  13. 36 fail. 93 succeed. (Focused on other tabs)
  14. 19 fail.
  15. 13 fail.
  16. 8 fail.

Mostly, the ones that work are the first in the list, but random pages in the middle are also sometimes successful.

For batches 6, 8, 9 and 13, I believe focusing on other tabs slowed the execution of the loop and allowed more to succeed.

I suggest either:

  • Increasing the delay time
  • Adding a configurable variable for the delay time
  • Dynamically increase the delay time after errors
  • Instead of sending a flood of requests, wait for a response before proceeding.

Increasing the delay time to 1000ms made it work fine for me. Sending one request at a time also worked fine for me. -452 (talk) 13:55, October 27, 2014 (UTC)

I appreciate the batch testing you've done for the script. I'll change it to 1000ms by default and allow the user to put in their own configurable variable before the script is imported if they'd like to set their own. – Ozuzanna 15:36, October 27, 2014 (UTC)

Weird thing

So I fail at life today and I forgot to add a namespace when I was going to null edit all the categories. And strangely enough it created the wrong page instead of placing it in the error console and say "missing title" like in Batch Delete or something else. Is this supposed to happen? Lia (wall) 13:11, May 8, 2015 (UTC)

I wouldn't say it's "supposed to" create new pages, but knowing how the script functions, that's what I would expect to happen if you added a page which didn't exist. Basically, the script submits an empty edit to the pages listed, so if the page doesn't exist, it submits an empty edit to that page, creating the page with no content.
The error message from AjaxBatchDelete is what the server responds with after attempting to delete the page. In this case, the server "successfully" submits the empty edit, so there's no error.
Updating the script to prevent blank pages being created would require first checking the page exists, involve doubling the traffic for each page, so I don't think this behaviour will, or should, be changed, but I do think the page should probably note that this is what will happen. -452 14:03, May 8, 2015 (UTC)
Yes I'm aware you can put in a parameter for the edit API to not create new pages, though the script can be used to fix glitched "deleted" pages without the parameter added which is why I didn't add it. – Ozuzanna 14:05, May 8, 2015 (UTC)
Oh! I see. Thanks for explaining it :) Having a bit of a note on what would happen if the namespace is forgotten is good as well. If it's not too much trouble. Lia 14:34, May 8, 2015 (UTC)
I didn't actually know about that parameter, but thanks for explaining why it wasn't used! -452 14:42, May 8, 2015 (UTC)

integrate mass null edit in my wikia

Hi, pls help

I clicked on the link w:Special:Mypage/global.js it will redirect to http://community.wikia.com/wiki/User:Huyphuc_bot/global.js. That's kind of create a new article, not show my global.js. And I create that page make no effect at all :(

Google search not help much.

Pls show me step by step, a quick video tutorial is nice. God bless you all!

Huyphuc bot (talk) 15:43, April 7, 2016 (UTC)

We don't have any videos, but that is the correct page. Special:MyPage is a redirect to your user page and it's a way of us being able to link to every user's page to make set up easier.
All you need to do is add the text in the instructions to that page and, after a few minutes, it should work. cqm 16:12, 7 Apr 2016 (UTC)
So sorry for the late reply, here's my page after add the script. Howerver, there is no new button in the toolbar at the bottom of the page?
Huyphuc bot (talk) 15:05, April 13, 2016 (UTC)
It should be inside the My Tools section--~UltimateSupreme 07:53, April 14, 2016 (UTC)
My Tools section has History,What links here and Theme Designer :( Huyphuc bot (talk) 03:12, April 15, 2016 (UTC)

Special pages

Currently the script automatically adds the listed pages if on Special:WhatLinksHere. However:

  • Could that be done for any list from special pages?
  • Can we have a button, like the one for adding categories, that make a request for a Special:WhatLinksHere list? Adding the list from the special page will only add the currently displayed ones, not all, and often there are more links that can fit a single page. It would be useful to just have a command like the one for categories, but instead for special pages (whatlinkshere in particular). As default value, it should autocomplete with the page you are currently on. leviathan_89 @fandom 14:57, November 10, 2017 (UTC)
Also can you please add i18n support? Thx. leviathan_89 @fandom 15:02, November 10, 2017 (UTC)

Mark as bot edits

Is there any reason why bot: true isn't included in the editApi object? I recently used this script to fix a problem with a small number of pages not showing up on a category page. Everything went seamless, except that I received emails notifying me about some of the pages being categorized, even though I had used an account with bot rights on the wiki. 14:59, September 18, 2020 (UTC)
There is, yeah. A null edit should never make an actual change to the page, but if it does (there's a handful of unusual situations where this can happen) it shouldn't be hidden as a bot/minor edit as it indicates something has gone wrong somewhere and may need attention. Surely Fandom wouldn't send emails out if the page was automatically refreshed via job queue, so I find it odd they'd send them out for a user-initiated null edit (basically the same thing). - OneTwoThreeFall talk 12:21, September 22, 2020 (UTC)
Hmm, I guess that makes sense. I wasn't aware of the possible changes. Well, I would probably have gotten those emails anyways if the pages would've been categorized initially, too. But categorization with Lua is sometimes a messy thing. Thanks for your answer! 22:11, September 22, 2020 (UTC)

Errors

What does the error "edit-gone-missing" mean? It sounds like no edit history, but when I visited the pages that gave me this error, they had a history. Psy Guy (talk) 19:59, September 22, 2020 (UTC)

That (usually) means you tried to save an edit to a page but the page you're editing doesn't seem to exist. Does this happen every time you edit a particular page? Can you edit the page normally, using the editor? - OneTwoThreeFall talk 13:23, September 23, 2020 (UTC)
I believe emptytitle is the error for pages that don't exist. I'm using the script on page comments, and it does happen every time on particular comments. I cannot edit them normally using the editor. Psy Guy (talk) 14:58, September 23, 2020 (UTC)
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+