Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.8
    • Fix Version/s: 2.1.10, 2.2
    • Component/s: Blocks: Ajax
    • Labels:
      None
    • Urgency:
      Normal
    • Other Info:
      Patch available

      Description

      Empty textareas in a repeater are displayed incorrectly by Internet
      Explorer after a round-trip to the server (for example after
      adding/deleting a row, or when a validation error occurs!)

      Instead of being empty, the textareas display a garbled mix of text and
      html-tags occurring in the html document. Submission of the form usually
      won't work afterwards...

      (See attachment for my post to the cocoon dev list, which contains the steps for reproducing the bug, and a possible fix for it)
      1. ASF.LICENSE.NOT.GRANTED--empty_textarea_ie.txt
        5 kB
        Fabrizio Sitzia
      2. ie_empty_textarea.gif
        0.7 kB
        Fabrizio Sitzia
      3. insertion.js.patch
        1 kB
        Guillaume Déflache

        Issue Links

          Activity

          Hide
          Fabrizio Sitzia added a comment -
          That's how the supposedly "empty" textarea looks like on IE, after adding one row...
          Show
          Fabrizio Sitzia added a comment - That's how the supposedly "empty" textarea looks like on IE, after adding one row...
          Hide
          Guillaume Déflache added a comment -
          I stumbled upon the same bug recently. Is there a particular reason (other than lack of time) why this patch is not commited yet?

          Before finding this bug I wrote another solution at the CForms level that basically modifies the stock 'textarea' styling so that textareas are never empty. Would it be a better solution? If so, I can provide a patch. Else I will happily apply the existing patch as is, hoping it will also be in the next released version.
          Show
          Guillaume Déflache added a comment - I stumbled upon the same bug recently. Is there a particular reason (other than lack of time) why this patch is not commited yet? Before finding this bug I wrote another solution at the CForms level that basically modifies the stock 'textarea' styling so that textareas are never empty. Would it be a better solution? If so, I can provide a patch. Else I will happily apply the existing patch as is, hoping it will also be in the next released version.
          Hide
          Antonio Gallardo added a comment -
          The ajax implementation shipped in cocoon 2.1.8 was dropped in favor of dojo [1] in cocon 2.1.9. Since there is no file called cocoon-ajax.jsin the trunk, we cannot apply the patch. :-(

          [1] http://dojotoolkit.org/
          Show
          Antonio Gallardo added a comment - The ajax implementation shipped in cocoon 2.1.8 was dropped in favor of dojo [1] in cocon 2.1.9. Since there is no file called cocoon-ajax.jsin the trunk, we cannot apply the patch. :-( [1] http://dojotoolkit.org/
          Hide
          Guillaume Déflache added a comment -
          Sorry, I had not noticed that... Guess that (unless anybody cares to fix it on the AJAX level) I will post a patch on CF styling here then.
          Show
          Guillaume Déflache added a comment - Sorry, I had not noticed that... Guess that (unless anybody cares to fix it on the AJAX level) I will post a patch on CF styling here then.
          Hide
          Guillaume Déflache added a comment -
          This patch applies to src/java/org/apache/cocoon/ajax/resources/js/insertion.js in AJAX block.

          It is simply the (trivial) adaptation of the previous 2.1.8 patch to 2.1.9.

          It was tested and works on 2.1.9.
          It is untested on current CVS maintainance and trunk branches.
          Show
          Guillaume Déflache added a comment - This patch applies to src/java/org/apache/cocoon/ajax/resources/js/insertion.js in AJAX block. It is simply the (trivial) adaptation of the previous 2.1.8 patch to 2.1.9. It was tested and works on 2.1.9. It is untested on current CVS maintainance and trunk branches.
          Hide
          Antonio Gallardo added a comment -
          Thanks for the patch. However I found there was already applied a patch in the trunk:

          http://svn.apache.org/viewvc?view=rev&revision=406636

          Would you kindly review if the applied patch works for you?

          Show
          Antonio Gallardo added a comment - Thanks for the patch. However I found there was already applied a patch in the trunk: http://svn.apache.org/viewvc?view=rev&revision=406636 Would you kindly review if the applied patch works for you?
          Hide
          Antonio Gallardo added a comment -
          I am closing, because the patch is already on the repository. Feel free to reopen the issue if needed.
          Show
          Antonio Gallardo added a comment - I am closing, because the patch is already on the repository. Feel free to reopen the issue if needed.
          Hide
          Guillaume Déflache added a comment -
          That's OK, the file taken from the trunk also works when put in Cocoon 2.1.9.

          For the record both trunk version and mine works, the only difference is that in my version "<texarea/>"'s are replaced before "script" elements are removed from the HTML text, instead of after in Cocoon trunk version.

          Is the fix now also on the 2.1.X branch?
          Show
          Guillaume Déflache added a comment - That's OK, the file taken from the trunk also works when put in Cocoon 2.1.9. For the record both trunk version and mine works, the only difference is that in my version "<texarea/>"'s are replaced before "script" elements are removed from the HTML text, instead of after in Cocoon trunk version. Is the fix now also on the 2.1.X branch?
          Hide
          Franchet Nicolas added a comment -
          The patch works fine for textareas, but the problem can occur with other html element. IE seems to not understand the tags with no content.

          instead of :
          var tmatch = new RegExp('(<textarea.*?)\/>', 'img');
          text = text.replace(tmatch, "$1></textarea>");

          we'd better do :
          var tmatch = new RegExp('<([A-Za-z]*)(.*?)\/>', 'img');
          text = text.replace(tmatch, "<$1 $2></$1>");

          Show
          Franchet Nicolas added a comment - The patch works fine for textareas, but the problem can occur with other html element. IE seems to not understand the tags with no content. instead of : var tmatch = new RegExp('(<textarea.*?)\/>', 'img'); text = text.replace(tmatch, "$1></textarea>"); we'd better do : var tmatch = new RegExp('<([A-Za-z]*)(.*?)\/>', 'img'); text = text.replace(tmatch, "<$1 $2></$1>");

            People

            • Assignee:
              Unassigned
              Reporter:
              Fabrizio Sitzia
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development