define( 'EDIT_FORCE_BOT', 16 );
define( 'EDIT_DEFER_UPDATES', 32 ); // Unused since 1.27
define( 'EDIT_AUTOSUMMARY', 64 );
+define( 'EDIT_INTERNAL', 128 );
/**@}*/
/**@{
$reason = wfMessage( 'double-redirect-fixed-' . $this->reason,
$this->redirTitle->getPrefixedText(), $newTitle->getPrefixedText()
)->inContentLanguage()->text();
- $article->doEditContent( $newContent, $reason, EDIT_UPDATE | EDIT_SUPPRESS_RC, false, $user );
+ $flags = EDIT_UPDATE | EDIT_SUPPRESS_RC | EDIT_INTERNAL;
+ $article->doEditContent( $newContent, $reason, $flags, false, $user );
$wgUser = $oldUser;
return true;
* Mark the edit a "bot" edit regardless of user rights
* EDIT_AUTOSUMMARY
* Fill in blank summaries with generated text where possible
+ * EDIT_INTERNAL
+ * Signal that the page retrieve/save cycle happened entirely in this request.
*
* If neither EDIT_NEW nor EDIT_UPDATE is specified, the status of the
* article will be detected. If EDIT_UPDATE is specified and the article
* Mark the edit a "bot" edit regardless of user rights
* EDIT_AUTOSUMMARY
* Fill in blank summaries with generated text where possible
+ * EDIT_INTERNAL
+ * Signal that the page retrieve/save cycle happened entirely in this request.
*
* If neither EDIT_NEW nor EDIT_UPDATE is specified, the status of the
* article will be detected. If EDIT_UPDATE is specified and the article
$summary = $handler->getAutosummary( $old_content, $content, $flags );
}
+ // Avoid statsd noise and wasted cycles check the edit stash (T136678)
+ if ( ( $flags & EDIT_INTERNAL ) || ( $flags & EDIT_FORCE_BOT ) ) {
+ $useCache = false;
+ } else {
+ $useCache = true;
+ }
+
// Get the pre-save transform content and final parser output
- $useCache = !( $flags & EDIT_FORCE_BOT ); // avoid statsd noise (T136678)
$editInfo = $this->prepareContentForEdit( $content, null, $user, $serialFormat, $useCache );
$pstContent = $editInfo->pstContent; // Content object
$meta = [
$summary = $wgContLang->truncate( $summary, 255 );
// Save
- $flags = EDIT_UPDATE;
+ $flags = EDIT_UPDATE | EDIT_INTERNAL;
if ( $guser->isAllowed( 'minoredit' ) ) {
$flags |= EDIT_MINOR;