Ticket #2508 (closed Bug: fixed)

Opened 6 years ago

Last modified 6 years ago

<ref> and <references /> tags break on edit

Reported by: oradke Owned by: arczi
Priority: Normal Milestone:
Component: Project : MediaWiki+FCKeditor Version: FCKeditor 2.6.3
Keywords: Confirmed Review+ Cc: oradke@…

Description

On editing a page with a <references /> tag at the end, the tag is replaced by wikicode:

&lt;references /&gt;

Attachments

2508.patch (2.8 KB) - added by arczi 6 years ago.
2508 _2.patch (3.3 KB) - added by arczi 6 years ago.

Change History

comment:1 Changed 6 years ago by wwalc

  • Keywords Pending WorksForMe added

Dou you have Cite extension installed? It seems to work on http://mediawiki.fckeditor.net.

Make sure that you're typing <references /> in the Wikitext mode.

comment:2 Changed 6 years ago by oradke

Here's how to reproduce it (Mediawiki 1.13, FCKEditor 2.6.3, latest SVN trunk, cite installed). Create a new page, enter a text with references:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <ref>http://www.nasa.gov</ref><br> 

= References  =

<references />

Click "Preview". Text shows correctly, but when you look at the wikitext inside the FCKEditor, it looks like this:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. &lt;ref&gt;http://www.nasa.gov&lt;/ref&gt;<br> 

= References  =

&lt;references /&gt;

comment:3 Changed 6 years ago by oradke

  • Summary changed from <references /> tag breaks on edit to <ref> and <references /> tags break on edit

I could reproduce it on latest Mediawiki 1.12 as well. Both <references /> and the <ref> tags are broken. I can provide a login to a test machine if that helps.

comment:4 follow-up: ↓ 5 Changed 6 years ago by oradke

  • Cc oradke@… added

Button to insert <references />-Tag works, but tags are still converted to "&lt;references /&gt;" on preview. It works on http://mediawiki.fckeditor.net, but not on my server. Any idea?

comment:5 in reply to: ↑ 4 Changed 6 years ago by oradke

Replying to oradke: Server info: MediaWiki 1.13.0 PHP 5.2.6 (apache2handler) MySQL 5.0.26

Parser hooks: Cite (Version r37577), Inputbox Other: FCKeditor (Version fckeditor/mw-extension $Rev$ 2008 Parser extension tags: <inputbox>, <pre>, <ref> and <references>

comment:6 Changed 6 years ago by maxcanis

Same thing occurs here, when you edit it in wikitext there isn't a problem, the problem lies when you open they page again for editing it automatically converts those tags to &lt;references /&gt; instead of preserving the tags. One thing I did notice is that the version of Cite is different, not sure if that's a factor but the http://mediawiki.fckeditor.net site doesn't actually state which version it is using. Unfortunately it has gotten to the point that I've had to discourage people from using the editor so that it doesn't break large pages that use lots of reference links.

comment:7 Changed 6 years ago by arczi

  • Keywords Confirmed added; Pending WorksForMe removed
  • Owner set to arczi
  • Status changed from new to assigned

Confirmed. Latest version (40290) of Cite is incompatible with the current MediaWiki+FCKeditor extension

Changed 6 years ago by arczi

comment:8 Changed 6 years ago by arczi

  • Keywords Review? added

comment:9 Changed 6 years ago by WakoNiko

Can't apply patch. Using last SVN revision of MediaWiki+FCKeditor and Cite.

$ patch -p0 < 2508.patch
(Stripping trailing CRs from patch.)
patching file FCKeditorParser.body.php
Hunk #1 FAILED at 153.
Hunk #2 FAILED at 166.
Hunk #3 FAILED at 179.
Hunk #4 FAILED at 199.
4 out of 4 hunks FAILED -- saving rejects to file FCKeditorParser.body.php.rej
(Stripping trailing CRs from patch.)
patching file mw12/FCKeditorParser_OldPP.body.php
Hunk #1 FAILED at 154.
Hunk #2 FAILED at 167.
Hunk #3 FAILED at 180.
Hunk #4 FAILED at 200.
4 out of 4 hunks FAILED -- saving rejects to file mw12/FCKeditorParser_OldPP.body.php.rej

comment:10 Changed 6 years ago by WakoNiko

Same goes with:

svn up -r "{2008-10-15 10:11:15 +0200}"

Can't apply the patch... Is it something wrong with me?

comment:11 Changed 6 years ago by WakoNiko

I ended up applying the patch manually, and it doesn't work anyway.

Apparently, it's working with Cite r35979, but not with r35980. So temporary solution is to:

svn up -r 35979

in Cite's directory. r35980 has been around since 06/07/2008, so it may be time for a fix...

comment:12 Changed 6 years ago by arczi

  • Keywords Review? removed

Changed 6 years ago by arczi

comment:13 Changed 6 years ago by arczi

  • Keywords Review? added

comment:14 Changed 6 years ago by WakoNiko

At first I couldn't apply your new patch, and then I figured that it's because your patches contain DOS newlines (\r\n) instead of UNIX newlines (\n) in the diff-specific lines (it's fine to have \r\n in the source-code lines, tho). I replaced the \r\n in the diff lines by \n and I could apply the patch. My system is fedora-core 6.

Anyway, about the patch itself, the new one works with the last SVN versions of everything. Thanks and I hope it gets integrated in the SVN soon.

comment:15 Changed 6 years ago by oradke

Tried the patch, works fine (MediaWiki 13.2., latest Cite and fckeditor SVN). Problem solved!

comment:16 Changed 6 years ago by wwalc

  • Keywords Review+ added; Review? removed
  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed with [3229] (the patch was outdated so I have manually applied all changes and did some minor corrections).

There is one ugly hack in this solution - ParserBeforeStrip hook was used to call the depraciated strip() function in MediaWiki 1.14.

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