Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#1385 closed Bug (fixed)

FCKeditor Converts to HTML on "Edit Conflict"

Reported by: Stephen R Owned by:
Priority: Normal Milestone:
Component: Project : MediaWiki+FCKeditor Version: SVN (FCKeditor) - Retired
Keywords: Confirmed HasPatch Cc:

Description

If you're in the process of making an edit and someone else edits the page, an "edit conflict" occurs. HOWEVER, unlike normal WikiText edits, FCKeditor compares the "new edited page" against an HTML marked-up version including your change.

As such, you can't just copy and paste the segments that you want to add to the new article. It's all lost in a bunch of HTML mark-up.

Attachments (4)

Untitled.png (21.5 KB) - added by Stephen R 12 years ago.
Picture of Error
conflict ie7 full.png (95.3 KB) - added by Nigel-5 11 years ago.
Ful page showing issues of text in the FCK editor
1385.patch (2.8 KB) - added by Wiktor Walc 11 years ago.
fix_for_1385_when_undo_can_be_performed.patch (1.8 KB) - added by Doru Moisa 11 years ago.
a fix for the showDiff() function called when the undo can be performed, when the needed hook is never called

Download all attachments as: .zip

Change History (14)

comment:1 Changed 12 years ago by Stephen R

Related to ticket #1174, I believe.

http://dev.fckeditor.net/ticket/1174

Changed 12 years ago by Stephen R

Attachment: Untitled.png added

Picture of Error

comment:2 Changed 12 years ago by Stephen R

Also related... if you "undo" a recent edit, it will compare the current revision (in wikitext) against the change (in html). This renders the comparison useless, since any changes are lost amidst the clutter.

Screenshot of this is attached.

comment:3 Changed 12 years ago by Stephen R

Sorry for the many posts...

I think what's going on here is that in the case of previews, undos, and conflicts -- the HTML being rendered in the edit box doesn't get passed through the wikitext converter that is used when you just hit the "Save" button normally. I haven't looked at the code, but it seems like you could fix all three of these errors by moving the "convert_to_wikitext()" function earlier in the code execution.

comment:4 Changed 12 years ago by Wiktor Walc

Stephen, your observations are correct. I haven't investigated it deeply yet, but it seems the problem is that in wpTextbox1 we keep now HTML code and this textarea is used by diff command in MediaWiki.

The only solution I can think of now is to change the way how FCKeditor is being loaded.

comment:5 Changed 12 years ago by Wojciech Olchawa

Keywords: Confirmed added
Priority: HighNormal

Changed 11 years ago by Nigel-5

Attachment: conflict ie7 full.png added

Ful page showing issues of text in the FCK editor

comment:6 Changed 11 years ago by Nigel-5

The issus is also a problem in the text that is rendered within the FCK editor because it does not translate the wikitext into HTML. This should be an easy fix? it would ease the crippling nature of the issue as mods could at least be reapplied.

Changed 11 years ago by Wiktor Walc

Attachment: 1385.patch added

comment:7 Changed 11 years ago by Wiktor Walc

Keywords: HasPatch added

Patch provided by moisadoru at #fckeditor irc channel.

Manual edit is only required in older versions of MediaWiki.

In current MediaWiki SVN, the new hook (EditPageBeforeEditConflict) is already available:

http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/EditPage.php?revision=33354&view=markup&sortby=date

comment:8 Changed 11 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

Fixed with [1929]. This will probably work with MediaWiki 1.12.1.

Earlier versions of MediaWiki have to be manually patched (new hook is required - see above):

For example in MW 1.11, in includes/EditPage.php, at the end of showEditForm function, find this code:

$wgOut->addHtml( wfHidden( 'wpAutoSummary', $autosumm ) );

if ( $this->isConflict ) {
	$wgOut->addWikiText( '==' . wfMsg( "yourdiff" ) . '==' );

and replace with:

$wgOut->addHtml( wfHidden( 'wpAutoSummary', $autosumm ) );

if ( $this->isConflict && wfRunHooks( 'EditPageBeforeConflictDiff', array( &$this, &$wgOut ) )) {
	$wgOut->addWikiText( '==' . wfMsg( "yourdiff" ) . '==' );

comment:9 Changed 11 years ago by Wiktor Walc

...actually this hook will be probably included in 1.13, so manual changes are required in MediaWiki 1.10-1.12.

Changed 11 years ago by Doru Moisa

a fix for the showDiff() function called when the undo can be performed, when the needed hook is never called

comment:10 Changed 11 years ago by Doru Moisa

I just added a patch for this particular issue, for the situation when you click on "show changes" button on the bottom, and the changeset can actualy be undone; in this case mediawiki has a different flow, and never calls the EditPageBeforeConflictDiff hook.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy