Jump to content

Extension talk:DeleteBatch/Archive 1

Add topic
From mediawiki.org

Not useable for deleting redirects

[edit]

This extension does not work for deleting redirects, because it tries to resolve the redirect before trying to delete the page. It should not do that unless the user specifically asks for redirects to be resolved. Even trying to change $wgDebugRedirects and $wgMaxRedirects did not work.

Deleting File Pages

[edit]

The extension is great help but File pages are not properly deleted. I deleted a batch of unused file pages, but they still were listed on Special:UnusedFiles afterwards. I had to open each page again from there and click "delete all" in the file history. --Subfader 16:40, 9 March 2009 (UTC)Reply

Unable to use this extension

[edit]

I have added this extension, but no matter what I do, I am unable to see any names in the list of users. When I submit a list, I am redirected to edit the main page.

Fatal error after installation

[edit]

After installation, index.php?title=Special:DeleteBatch says: Fatal error: Class 'XmlSelect' not found in C:\domains\mydomain.com\wwwroot\wiki\extensions\DeleteBatch\DeleteBatch.body.php on line 145

Anyone who knows how to solve this? Tnx! 84.31.241.145 00:51, 7 August 2009 (UTC)Reply

Use DeleteBatch 1.1 ; 1.3 has bug with mediawiki 1.5. 90.54.112.156 10:43, 19 August 2009 (UTC)Reply
Hi, which revision in SVN is v1.1?
Thanks!
mitchelln 16:23, 5th November 2009 (GMT)

I have found revision 52529 to work. El Sjaako 15:51, 29 November 2009 (UTC)Reply

Does not properly delete file/page

[edit]

In trying to delete an image/page using the form, entering for example:

File:Image.jpg

...and pressing the DELETE button, the following notice is returned:

"File:Image.jpg" has been deleted. See deletion log for a record of recent deletions."

If the action is repeated on the same file/image name, then the script will return:

"Omitting non-existing page File:Image.jpg."

... sar far so good. At least the script is aware of that the image or page was deleted. However, the page still exists with all it's revisions, so it does not work. I'm using the MediaWiki 1.15.1and the matching DeleteBatch for version 1.15.x. So this snapshot is definitely not working.

Are there other extensions or maintenance scripts that does the same or a similar thing? In the meantime, I'm reverting to the tedious process of manual mass deletion.....

--Yellowdog 18:29, 25 March 2010 (UTC)Reply

Update: My misunderstanding above, this extension does not delete images, it deletes pages. Pages for images are obviously just containers for existing images and it should not work to remove Images by removing the corresponding File: pages.

I just ran this script to delete a test page and that worked fine.

I'm still looking for a way to delete a batch of images, either by an extension or maintenance script. Does anyone have any tips?

--Yellowdog 17:42, 29 March 2010 (UTC)Reply

Solution

[edit]

VitaliyFilippov 14:01, 15 June 2011 (UTC)Reply

This is DeleteBatch's bug, the code looks like the author wanted to delete uploads together with pages, but failed to write it correctly :) Apply this simple patch:

--- extensions/DeleteBatch/DeleteBatch.body.php
+++ extensions/DeleteBatch/DeleteBatch.body.php
@@ -290,14 +290,15 @@
 			/*this is absolutely required - creating a new ImagePage object does not automatically
 			provide it with image  */
 			$art->img = new Image( $art->mTitle );
+			$art->delete();
 		} else {
 			$art = new Article( $page );
+			$art->doDelete( $reason );
 		}
 
 		/* what is the generic reason for page deletion?
 		   something about the content, I guess...
 		*/
-		$art->doDelete( $reason );
 		$db->commit();
 		return true;
 	}

VitaliyFilippov 14:01, 15 June 2011 (UTC)Reply

Evidently some changes in the core rendered this non-functional, because I don't see any Image class in the code docs. You need to use the LocalFile class, or maybe the LocalFileDeleteBatch class. My guess is that rather than doing the type of if-then-else that presently is there, you'll want to first have it delete the File: page (if it exists), and then have it delete the actual file (if it exists). I was able to hack it sufficiently to get a makeshift solution working that used wfLocalFile. Leucosticte (talk) 07:24, 4 October 2012 (UTC)Reply

Can someone attest if file deletion have been fixed in later versions ? 90.32.102.114 19:32, 19 May 2015 (UTC)Reply

Is this mostly used for combating vandalism/spam/banned users or for doing other kinds of maintenance?

[edit]

I was thinking of creating an Extension:BlankBatch for use in blanking large numbers of nonsense articles and such created by malicious users on wikis that use Extension:PWD and have a policy of blanking such pages rather than deleting them, but wasn't sure if this tool is really used for combating that kind of thing. I've mostly used DeleteBatch for fixing issues related to outdated templates. Tisane 08:25, 31 March 2010 (UTC)Reply

Partially compatible with MW 1.16.0

[edit]

Uploading a file of a list of pages to delete does not work with MW 1.16.0. Is anyone else having this issue? Thanks in advance. --Dgennaro 17:06, 11 August 2010 (UTC)Reply

Affirmative. This method of indicating the pages to delete does not work for me with MW 1.16.0 and 1.16.1 too. Cheers --[[kgh]] 23:05, 16 January 2011 (UTC)Reply
The same for MW 1.17. Anyone know how to fix it? Cheers

Fails with 18.1

[edit]

Adding require_once("$IP/extensions/DeleteBatch/DeleteBatch.php"); to LocalSettings, where this path contains the full subversion checkout as of 18.1., results in "HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request." - no php error message is shown. Many other extensions work ok on the system - not sure what the root cause is. G.Hagedorn (talk) 22:06, 18 June 2012 (UTC)Reply

Fatal Error User::getEditToken()

[edit]

Hi i get the following after installation...

Fatal error: Call to undefined method User::getEditToken() in C:\xampp\htdocs\wiki\extensions\DeleteBatch\DeleteBatch.body.php on line 161

Any help much appreciated

  • MediaWiki 1.18.1
  • PHP 5.3.8 (apache2handler)
  • MySQL 5.5.16

Luke 195.43.48.142 11:07, 5 December 2012 (UTC)Reply

Call to undefined function mime_content_type()

[edit]

Version 1.4 fails on MediaWiki 1.20.2 with the error Call to undefined function mime_content_type(), in line 224 of DeleteBatch.body.php --Robkam (talk) 16:19, 25 December 2012 (UTC)Reply

Notice: Undefined offset:

[edit]

On MediaWiki 1.20.2 with version 1.4, I'm not sure why, but it could be because the delete page script refers to pages not found. For each missing page it gives out Notice: Undefined offset: 1 in ..\extensions\DeleteBatch\DeleteBatch.body.php on line 258 --Robkam (talk) 22:57, 26 December 2012 (UTC)Reply

Fatal error with 1.21.2

[edit]

Apache/2.2.22 (Ubuntu) DAV/2 mod_fastcgi/mod_fastcgi-SNAP-0910052141 PHP/5.3.10-1ubuntu3.8 with Suhosin-Patch mod_ssl/2.2.22 OpenSSL/1.0.1 mod_perl/2.0.5 Perl/v5.14.2 configured -- resuming normal operations PHP Fatal error: Call to undefined function count() in /var/lib/mediawiki-1.21.2/includes/filebackend/lockmanager/FSLockManager.php on line 240

Extension:DeleteBatch on Wikimedia Commons

[edit]

I just requested activation of Extension:DeleteBatch on Wikimedia Commons. See bugzilla:59793. Can anybody maintaining this code assist in the process? --Jarekt (talk) 20:54, 7 January 2014 (UTC)Reply

To the mantainer: Adapt Extension:DeleteBatch to allow suppress (oversight) deletion

[edit]

Please see phab:T124669. Best regards, --Marco Aurelio (talk • meta) 10:22, 26 April 2016 (UTC)Reply

Hook

[edit]

It would be very handy if there were to be a hook triggered when the page is deleted with a copy of the page attached. [08-08-2017]

Update .. Just went through the code .. seems 'ArticleDelete' hook should be triggered.. and it is..

"The user can delete pages either through the form or by uploading a text file containing the names (and optional delete reasons) of the deletable pages."

[edit]

Please document this and how the file name should be named. Thanks. —MarcoAurelio (talk) 22:04, 1 December 2017 (UTC)Reply

Extension Missing Extension.json?

[edit]

I installed this extension on my local wiki running the latest MediaWiki (as of 2/8/2018), and I downloaded the latest version of this extension (also as of 2/8/2018). I added the appropriate lines in the Settings file, but when I go to browse the wiki, nothing is loaded. I look in the Apache log files and it says the extension is missing the file Extension.json. I downloaded the extension again to make sure it wasn't just a faulty download but it is also missing when I did it again. Anybody knows what happened to that file? ChristianSirolli (talk) 17:38, 8 February 2018 (UTC)Reply

@ChristianSirolli: Hi Christian, please download extension from master branch and only add extension.json in DeleteBatch folder. It will resolve this problem. Zoranzoki21 (talk) 21:16, 13 February 2018 (UTC)Reply

Internal error: Cannot create a user with no name, no ID, and no actor ID

[edit]

I'm running MediaWiki 1.32.0-alpha and get this error when I try to mass delete pages. Any help or insight would be greatly appreciated.

[5b5c15c05e0e1e719a3a576b] /index.php?title=Special:DeleteBatch&action=submit InvalidArgumentException from line 680 of /var/www/html/includes/user/User.php: Cannot create a user with no name, no ID, and no actor ID

Backtrace:

#0 /var/www/html/includes/page/WikiPage.php(2917): User::newFromAnyId(string, string, NULL)
#1 /var/www/html/includes/page/WikiPage.php(2768): WikiPage->doDeleteArticleReal(string, boolean, NULL, NULL, string, User)
#2 /var/www/html/extensions/DeleteBatch/DeleteBatch.body.php(357): WikiPage->doDeleteArticle(string)
#3 /var/www/html/extensions/DeleteBatch/DeleteBatch.body.php(277): DeleteBatchForm->deletePage(string, string, Wikimedia\Rdbms\DatabaseMysqli, boolean, integer, User)
#4 /var/www/html/extensions/DeleteBatch/DeleteBatch.body.php(393): DeleteBatchForm->deleteBatch(NULL, string, string)
#5 /var/www/html/extensions/DeleteBatch/DeleteBatch.body.php(50): DeleteBatchForm->doSubmit()
#6 /var/www/html/includes/specialpage/SpecialPage.php(522): SpecialDeleteBatch->execute(NULL)
#7 /var/www/html/includes/specialpage/SpecialPageFactory.php(569): SpecialPage->run(NULL)
#8 /var/www/html/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
#9 /var/www/html/includes/MediaWiki.php(863): MediaWiki->performRequest()
#10 /var/www/html/includes/MediaWiki.php(524): MediaWiki->main()
#11 /var/www/html/index.php(42): MediaWiki->run()
#12 {main}

--HausaDictionary (talk) 20:55, 2 June 2018 (UTC)Reply

Minor bug: summary field tab-order not correct

[edit]
Version
1.8.1 (8d186e0) 10:17, 17 September 2018
Issue
When tab-ing through the fields of the delete-batch page, the "Default deletion reason" field is skipped,
and focus given only after all the controls of the page has been visited.

Ankostis (talk) 17:58, 26 January 2019 (UTC)Reply

Reported as task T232158. --[[kgh]] (talk) 20:49, 5 September 2019 (UTC)Reply