$page: the WikiPage of the candidate edit
$content: the Content object of the candidate edit
$output: the ParserOutput result of the candidate edit
+$summary: the change summary of the candidate edit
+$user: the User considering the edit
'PasswordPoliciesForUser': Alter the effective password policy for a user.
$user: User object whose policy you are modifying
if ( $user->pingLimiter( 'stashedit' ) ) {
$status = 'ratelimited';
} elseif ( $dbw->lock( $key, __METHOD__, 1 ) ) {
- $status = self::parseAndStash( $page, $content, $user );
+ $status = self::parseAndStash( $page, $content, $user, $params['summary'] );
$dbw->unlock( $key, __METHOD__ );
} else {
$status = 'busy';
/**
* @param WikiPage $page
- * @param Content $content
+ * @param Content $content Edit content
* @param User $user
+ * @param string $summary Edit summary
* @return integer ApiStashEdit::ERROR_* constant
* @since 1.25
*/
- public static function parseAndStash( WikiPage $page, Content $content, User $user ) {
+ public static function parseAndStash( WikiPage $page, Content $content, User $user, $summary ) {
$cache = ObjectCache::getLocalClusterInstance();
$logger = LoggerFactory::getInstance( 'StashEdit' );
$key = self::getStashKey( $title, $content, $user );
// Let extensions add ParserOutput metadata or warm other caches
- Hooks::run( 'ParserOutputStashForEdit', [ $page, $content, $editInfo->output ] );
+ Hooks::run( 'ParserOutputStashForEdit',
+ [ $page, $content, $editInfo->output, $summary, $user ] );
list( $stashInfo, $ttl, $code ) = self::buildStashValue(
$editInfo->pstContent,
ApiBase::PARAM_TYPE => 'text',
ApiBase::PARAM_REQUIRED => true
],
+ 'summary' => [
+ ApiBase::PARAM_TYPE => 'string',
+ ],
'contentmodel' => [
ApiBase::PARAM_TYPE => ContentHandler::getContentModels(),
ApiBase::PARAM_REQUIRED => true
"apihelp-stashedit-param-contentmodel": "Content model of the new content.",
"apihelp-stashedit-param-contentformat": "Content serialization format used for the input text.",
"apihelp-stashedit-param-baserevid": "Revision ID of the base revision.",
+ "apihelp-stashedit-param-summary": "Change summary.",
"apihelp-tag-description": "Add or remove change tags from individual revisions or log entries.",
"apihelp-tag-param-rcid": "One or more recent changes IDs from which to add or remove the tag.",
"apihelp-stashedit-param-contentmodel": "{{doc-apihelp-param|stashedit|contentmodel}}",
"apihelp-stashedit-param-contentformat": "{{doc-apihelp-param|stashedit|contentformat}}",
"apihelp-stashedit-param-baserevid": "{{doc-apihelp-param|stashedit|baserevid}}",
+ "apihelp-stashedit-param-summary": "{{doc-apihelp-param|stashedit|summary}}",
"apihelp-tag-description": "{{doc-apihelp-description|tag}}",
"apihelp-tag-param-rcid": "{{doc-apihelp-param|tag|rcid}}",
"apihelp-tag-param-revid": "{{doc-apihelp-param|tag|revid}}",