Page MenuHomePhabricator

Endless loop between forceeditsummary and Abusefilter warnings
Closed, DuplicatePublic

Description

On frwiki, I use the forceeditsummary option (Preferences/Editing/Editor), but I sometimes I just ignore the warning, for example in case of a revert when I think it is self-explaining.

While doing this edit (the page was subject to Abusefilter 36) I got locked in a endless loop of warnings: each time I clicked the save button to ignore one of those warnings, the other one was preventing me from effectively saving the page.

(note: I was able to finally save the page because I know that adding a whitespace to the summary suppresses the forceeditsummary warning without changing the final value, but this is not something a user should be supposed to know)

Event Timeline

Aklapper triaged this task as Medium priority.Apr 25 2016, 9:05 AM

I believe that this is caused by the following in EditPage.php

EditPage::internalAttemptSave
if ( !$this->runPostMergeFilters( $content, $status, $user ) ) {
	return $status;
}
if ( $this->section == 'new' ) {
	// Handle the user preference to force summaries here
	if ( !$this->allowBlankSummary && trim( $this->summary ) == '' ) {
		$this->missingSummary = true;
		$status->fatal( 'missingsummary' ); // or 'missingcommentheader' if $section == 'new'. Blegh
		$status->value = self::AS_SUMMARY_NEEDED;
		return $status;
	}
	// Do not allow the user to post an empty comment
	if ( $this->textbox1 == '' ) {
		$this->missingComment = true;
		$status->fatal( 'missingcommenttext' );
		$status->value = self::AS_TEXTBOX_EMPTY;
		return $status;
	}
} elseif ( !$this->allowBlankSummary
	&& !$content->equals( $this->getOriginalContent( $user ) )
	&& !$content->isRedirect()
	&& md5( $this->summary ) == $this->autoSumm
) {
	$this->missingSummary = true;
	$status->fatal( 'missingsummary' );
	$status->value = self::AS_SUMMARY_NEEDED;
	return $status;
}

By calling runPostMergeFilters before the user preference is enforced, after a warning, the user preference is enforced and the process restarts. Would switching this so that runPostMergeFilters is called after the preference is enforced fix it?

Please do not merge tasks in the wrong direction unless there is a massive amount more detail on the newer task.

Please do not merge tasks in the wrong direction unless there is a massive amount more detail on the newer task.

Sorry, didn't realize the other one was older