Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #4588 (reopened defect)

Opened 2 years ago

Last modified 1 year ago

[PATCH] Ajax.inPlaceEditor and special characters

Reported by: juanodicio@gmail.com Assigned to: Rails
Priority: high Milestone: 2.x
Component: script.aculo.us Version: 1.1.1
Severity: normal Keywords: controls
Cc:

Description

When the text "to edit" have special characters like & , < and > it shows itself as HTML entities (&amp; &gt; &lt;) and the final user doesn't understand

Attachments

controls.js (28.2 kB) - added by juanodicio@gmail.com on 04/04/06 23:33:02.
controls.js modified lines: 594 and 607
controls-1.6.4.diff (0.9 kB) - added by mathieu on 09/21/06 12:31:16.
diff for html characters in inplaceeditor

Change History

04/04/06 23:33:02 changed by juanodicio@gmail.com

  • attachment controls.js added.

controls.js modified lines: 594 and 607

08/19/06 02:57:36 changed by tomg@byu.net

  • keywords changed from ajax inPlaceEditor to controls.

Duplicate of #3485 ?

08/19/06 03:23:23 changed by tomg@byu.net

  • priority changed from normal to high.

#4826 closed as duplicate of this bug.

I'm also raising the priority, as this seems to be an oft requested fix.

09/03/06 23:07:50 changed by madrobby

  • status changed from new to closed.
  • resolution set to untested.

Please add a proper diff file and augment the tests.

09/21/06 12:31:16 changed by mathieu

  • attachment controls-1.6.4.diff added.

diff for html characters in inplaceeditor

09/21/06 13:00:24 changed by mathieu

  • status changed from closed to reopened.
  • resolution deleted.

I don't understand everything that needs to be done in order to properly insert a test in the test/unit/ajax_inplaceeditor_test.html file. So I modified directly the :

<h1 id="tobeedited">To be edited</h1>

to :

<h1 id="tobeedited">To be edited &</h1>

Without the patch the testInPlaceEditor failes :

31 assertions, 2 failures, 0 errors Failure: assertEqual: expected "'To be edited &'", actual "'To be edited &amp;'" Failure: assertEqual: expected "'To be edited &'", actual "'To be edited &amp;'"

With the patch the testInPlaceEditor passes : 33 assertions, 0 failures, 0 errors

I did the same tests for multiline edition.

All other tests succeed with the patch.

Thanks to anyone able to properly implement a test suite.

03/12/07 23:51:18 changed by Glorat

Hi all,

Just wanted to comment that there is a dupe posted at #7607. However, IMHO, the patch at #7606 is clearer than this one. I'm not familiar with the test suite but the test as described just above my post is exactly the test needed. FWIW, I've successfully applied the #7606 patch on my production site

Regards,