Page MenuHomePhabricator

Minor, watch checkboxes are reset following an edit conflict
Closed, DeclinedPublic

Description

Author: FT2.wiki

Description:
When a user's post is edit conflicted, the edit summary is preserved in the new edit screen, but the checkboxes for "minor edit" and "watch this page" are not.

Can those be kept as the user had selected them too?


Version: unspecified
Severity: minor

Details

Reference
bz19886

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:41 PM
bzimport set Reference to bz19886.

Clarified summary; assigning to Trevor as part of editing screen cleanup.

mac.med02 wrote:

I apologize if this is completely wrong, but would something as simple as this work? (Disclosure: completely new to this, just giving it a shot.)

Index: EditPage.php

  • EditPage.php (revision 57025)

+++ EditPage.php (working copy)
@@ -991,10 +991,10 @@

if ( $this->isConflict ) {
        wfDebug( "EditPage::editForm conflict! getting section '

$this->section' for time '$this->edittime' (article time '" .

$this->mArticle->getTimestamp() . "')\n" );
  • $text = $this->mArticle->replaceSection( $this->section, $this->textbox1, $this->summary, $this->edittime );

+ $text = $this->mArticle->replaceSection( $this->section,
$this->textbox1, $this->summary, $this->edittime, $this->minoredit, $this->watc
hthis );

} else {
        wfDebug( "EditPage::editForm getting section '$this->sec

tion'\n" );

  • $text = $this->mArticle->replaceSection( $this->section, $this->textbox1, $this->summary );

+ $text = $this->mArticle->replaceSection( $this->section,
$this->textbox1, $this->summary, $this->minoredit, $this->watchthis );

}
if ( is_null( $text ) ) {
        wfDebug( "EditPage::editForm activating conflict; sectio

n replace failed.\n" );

mac.med02 wrote:

Attempted fix.

Attached:

(In reply to comment #3)

Created an attachment (id=6601) [details]
Attempted fix.

Please attach a patch instead of the complete EditPage.php file.

(In reply to comment #2)

I apologize if this is completely wrong, but would something as simple as this
work? (Disclosure: completely new to this, just giving it a shot.)

You're passing extra parameters to Article::replaceSection(), so you'd need to modify that function to actually do something with them. Either way, replaceSection() is not the right place to do this, as it simply merges two sets of changes and returns the result. The return value (which is assigned to $text) is just plain text and has no way of storing complex stuff such as minor and watch toggles.

mac.med02 wrote:

Seems to work when trying to emulate the problem.