content is not being preserved. 'fromsection-{slot}' and 'tosection-{slot}'
instead expand the given text as if for a section edit. This effectively
declines T183823 in favor of T185723.
+* (T198214) The 'disabletidy' parameter to action=parse has been
+ deprecated; untidy output will not be supported by future wikitext
+ parsers.
=== Action API internal changes in 1.32 ===
* Added 'ApiParseMakeOutputPage' hook.
Wikimedia\Rdbms\LBFactory.
* The MimeMagic class, deprecated since 1.28 has been removed. Get a
MimeAnalyzer instance from MediaWikiServices instead.
+* The '--tidy' option to maintenance/parse.php has been removed. Tidying
+ the output is now the default. Use '--no-tidy' to bypass the tidy
+ phase.
=== Deprecations in 1.32 ===
* HTMLForm::setSubmitProgressive() is deprecated. No need to call it. Submit
'EmailNotification' => __DIR__ . '/includes/mail/EmailNotification.php',
'EmaillingJob' => __DIR__ . '/includes/jobqueue/jobs/EmaillingJob.php',
'EmptyBagOStuff' => __DIR__ . '/includes/libs/objectcache/EmptyBagOStuff.php',
+ 'EmptyUserGroup' => __DIR__ . '/maintenance/emptyUserGroup.php',
'EnConverter' => __DIR__ . '/languages/classes/LanguageEn.php',
'EncryptedPassword' => __DIR__ . '/includes/password/EncryptedPassword.php',
'EnhancedChangesList' => __DIR__ . '/includes/changes/EnhancedChangesList.php',
],
'disablelimitreport' => false,
'disableeditsection' => false,
- 'disabletidy' => false,
+ 'disabletidy' => [
+ ApiBase::PARAM_DFLT => false,
+ ApiBase::PARAM_DEPRECATED => true, // Since 1.32
+ ],
'disablestylededuplication' => false,
'generatexml' => [
ApiBase::PARAM_DFLT => false,
--- /dev/null
+<?php
+
+/**
+ * Removes all users from a given user group.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+require_once __DIR__ . '/Maintenance.php';
+
+use MediaWiki\MediaWikiServices;
+
+class EmptyUserGroup extends Maintenance {
+ public function __construct() {
+ parent::__construct();
+ $this->addDescription( 'Remove all users from a given user group' );
+ $this->addArg( 'group', 'Group to be removed', true );
+ }
+
+ public function execute() {
+ $group = $this->getArg( 0 );
+
+ $lb = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+
+ $users = User::findUsersByGroup( $group );
+
+ $count = iterator_count( $users );
+
+ $this->output( "Removing $count users from $group..." );
+
+ /**
+ * @var User $user
+ */
+ foreach ( $users as $user ) {
+ $user->removeGroup( $group );
+
+ $lb->waitForReplication();
+ }
+
+ $this->output( " Done!\n" );
+ }
+}
+
+$maintClass = EmptyUserGroup::class;
+require_once RUN_MAINTENANCE_IF_MAIN;
false,
true
);
- $this->addOption( 'tidy', 'Tidy the output' );
+ $this->addOption( 'no-tidy', 'Don\'t tidy the output (deprecated)' );
$this->addArg( 'file', 'File containing wikitext (Default: stdin)', false );
}
* @return string HTML Rendering
*/
public function render( $wikitext ) {
- return $this->parse( $wikitext )->getText();
+ return $this->parse( $wikitext )->getText( [ 'wrapperDivClass' => '' ] );
}
/**
* @return ParserOutput
*/
protected function parse( $wikitext ) {
- $options = new ParserOptions;
- if ( $this->getOption( 'tidy' ) ) {
- $options->setTidy( true );
+ $options = ParserOptions::newCanonical();
+ $options->setOption( 'enableLimitReport', false );
+ if ( $this->getOption( 'no-tidy' ) ) {
+ $options->setTidy( false );
}
return $this->parser->parse(
$wikitext,
}
}
+ // Re-enable any disabled deprecation warnings
+ MWDebug::clearLog();
// Restore mw globals
foreach ( $this->mwGlobals as $key => $value ) {
$GLOBALS[$key] = $value;
/**
* Test the actual behavior of the method (in the case where it doesn't throw, e.g., in
- * production). Since it threw an exception once in this file, it won't when we call it again.
+ * production).
*
* @covers OutputPage::addScriptFile
*/
public function testAddDeprecatedScriptFileNoOp() {
+ $this->hideDeprecated( 'OutputPage::addScriptFile' );
$op = $this->newInstance();
$op->addScriptFile( 'ignored-script.js' );
* @param array $expect
*/
public function testGetMessageFromException_BC( $exception, $options, $expect ) {
+ if ( $exception instanceof UsageException ) {
+ $this->hideDeprecated( 'UsageException::getMessageArray' );
+ }
+
$result = new ApiResult( 8388608 );
$formatter = new ApiErrorFormatter_BackCompat( $result );
$this->assertCount( 1, $res[0] );
} else {
$this->assertCount( 2, $res[0] );
- // This deliberately fails if there are extra warnings
- $this->assertSame( [ 'parse' => [ 'warnings' => $warnings ] ], $res[0]['warnings'] );
+ $this->assertSame( [ 'warnings' => $warnings ], $res[0]['warnings']['parse'] );
}
}
'disabletidy' => '',
] );
- $this->assertParsedTo( "<p><b>Mixed <i>up</b></i>\n</p>", $res2 );
+ $this->assertParsedTo( "<p><b>Mixed <i>up</b></i>\n</p>", $res2,
+ 'The parameter "disabletidy" has been deprecated.' );
}
public function testFormatCategories() {
$this->setMwGlobals( 'wgDevelopmentWarnings', false );
}
- public function tearDown() {
- parent::tearDown();
- MWDebug::clearLog();
- }
-
/**
* @dataProvider provideGet
*/