Ticket #1385 (closed Bug: fixed)

Opened 9 months ago

Last modified 3 months ago

FCKeditor Converts to HTML on "Edit Conflict"

Reported by: Stephen R Owned by:
Priority: Normal Milestone:
Component: Project : MediaWiki+FCKeditor Version: SVN
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

Untitled.png (21.5 kB) - added by Stephen R 9 months ago.
Picture of Error
conflict ie7 full.png (95.3 kB) - added by nigel5 4 months ago.
Ful page showing issues of text in the FCK editor
1385.patch (2.8 kB) - added by wwalc 3 months ago.
fix_for_1385_when_undo_can_be_performed.patch (1.8 kB) - added by moisadoru 3 months ago.
a fix for the showDiff() function called when the undo can be performed, when the needed hook is never called

Change History

Changed 9 months ago by Stephen R

Related to ticket #1174, I believe.

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

Changed 9 months ago by Stephen R

Picture of Error

Changed 9 months 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.

Changed 9 months 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.

Changed 9 months ago by wwalc

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.

Changed 5 months ago by w.olchawa

  • keywords Confirmed added
  • priority changed from High to Normal

Changed 4 months ago by nigel5

Ful page showing issues of text in the FCK editor

Changed 4 months ago by nigel5

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 3 months ago by wwalc

Changed 3 months ago by wwalc

  • 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

Changed 3 months ago by wwalc

  • status changed from new to closed
  • resolution set to fixed

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" ) . '==' );

Changed 3 months ago by wwalc

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

Changed 3 months ago by moisadoru

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

Changed 3 months ago by moisadoru

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.