Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-21336

eZOE: Using IE8, every publish adds another empty paragraph at the end.

    Details

      Description

      While editing content in xml block with eZOE (admin backend), an empty paragraph is added at the end.

      When using IE8, every time the content is published another empty paragraph is added.
      This is visible in the frontent, making the content "grow" in size.

      1. 1_create_new_article.log
        26 kB
        Joao Inacio
      2. 2_publish_new_article.log
        27 kB
        Joao Inacio
      3. 3_edit_article.log
        2 kB
        Joao Inacio
      4. 36a8093f482eaff3c7c6098cf1b89e28710d68e4_fixed_5.0_5.1.patch
        2 kB
        Yannick Roger
      5. 4_publish_article.log
        45 kB
        Joao Inacio
      6. phpinfo.htm
        75 kB
        Joao Inacio
      1. frontend screenshot.jpg
        128 kB

        Issue Links

          Activity

          Hide
          Damien Pobel (Inactive) added a comment -

          Joao: I'm not able to reproduce this issue. Online Editor indeed adds an empty paragraph at the end of the content area (to not block the editor in some cases) but this empty paragraph is removed so the content does not "grow". I tested with IE8 on XP and IE8 on Win7.
          Could you please add more details on the steps to reproduce ? do you add something specific in OE ?
          Could you also enabled the "debug redirection", the debug output and put something like:

          <?php /*
          [GeneralCondition]
          kernel-datatype-ezxmltext-ezoe=enabled
          kernel-datatype-ezxmltext=enabled
           
          */ ?>

          in settings/override/debug.ini.append.php and then redo the test and paste here the debug output before the redirection.

          Show
          Damien Pobel (Inactive) added a comment - Joao: I'm not able to reproduce this issue. Online Editor indeed adds an empty paragraph at the end of the content area (to not block the editor in some cases) but this empty paragraph is removed so the content does not "grow". I tested with IE8 on XP and IE8 on Win7. Could you please add more details on the steps to reproduce ? do you add something specific in OE ? Could you also enabled the "debug redirection", the debug output and put something like: <?php /* [GeneralCondition] kernel-datatype-ezxmltext-ezoe=enabled kernel-datatype-ezxmltext=enabled   */ ?> in settings/override/debug.ini.append.php and then redo the test and paste here the debug output before the redirection.
          Hide
          Joao Inacio (Inactive) added a comment - - edited

          Attached debug logs for each step.

          The difference between editing within IE and others (at least Chrome), is that the supposed empty paragraph contains a space:

          <p>&nbsp;</p>

          so it is not actually empty... possible javascript issue?

          Show
          Joao Inacio (Inactive) added a comment - - edited Attached debug logs for each step. The difference between editing within IE and others (at least Chrome), is that the supposed empty paragraph contains a space: <p>&nbsp;</p> so it is not actually empty... possible javascript issue?
          Hide
          Damien Pobel (Inactive) added a comment - - edited

          Joao: getting <p>&nbsp;</p> at the end with IE is the normal behaviour. But it should be removed while processing the HTML/XML server side, and it is the case on my setup. So now, the question is why that's not the case in your test environment. Could you try to apply the following patch:

          diff --git a/extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php b/extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php
          index ba25b13..6564137 100644
          --- a/extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php
          +++ b/extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php
          @@ -592,7 +592,7 @@ class eZOEXMLInput extends eZXMLInputHandler
                           if ( !$textChild ||
                                ( $lastChild->childNodes->length == 1 &&
                                  $textChild->nodeType == XML_TEXT_NODE &&
          -                       ( $textChild->textContent == " " || $textChild->textContent == ' ' || $textChild->textContent == '' || $textChild->textContent == '&nbsp;' ) ) )
          +                       ( $textChild->textContent == " " || $textChild->textContent == ' ' || $textChild->textContent == '' || $textChild->textContent == '&nbsp;' || $textChild->textContent == "\xC2\xA0" ) ) )
                           {
                               $parent->removeChild( $lastChild );
                           }
          

          and then retest to see if it fixes the issue ?

          Show
          Damien Pobel (Inactive) added a comment - - edited Joao: getting <p>&nbsp;</p> at the end with IE is the normal behaviour. But it should be removed while processing the HTML/XML server side, and it is the case on my setup. So now, the question is why that's not the case in your test environment. Could you try to apply the following patch: diff --git a/extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php b/extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php index ba25b13..6564137 100644 --- a/extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php +++ b/extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php @@ -592,7 +592,7 @@ class eZOEXMLInput extends eZXMLInputHandler if ( !$textChild || ( $lastChild->childNodes->length == 1 && $textChild->nodeType == XML_TEXT_NODE && - ( $textChild->textContent == " " || $textChild->textContent == ' ' || $textChild->textContent == '' || $textChild->textContent == '&nbsp;' ) ) ) + ( $textChild->textContent == " " || $textChild->textContent == ' ' || $textChild->textContent == '' || $textChild->textContent == '&nbsp;' || $textChild->textContent == "\xC2\xA0" ) ) ) { $parent->removeChild( $lastChild ); } and then retest to see if it fixes the issue ?
          Hide
          Joao Inacio (Inactive) added a comment -

          @Damien:

          The patch did not apply cleanly (special chars or copy/paste issue? In my editor(s) the following is displayed:

                          $textChild = $lastChild->lastChild;
                          // $textChild->textContent == "??" : string(2) whitespace in Opera
                          if ( !$textChild ||
                               ( $lastChild->childNodes->length == 1 &&
                                 $textChild->nodeType == XML_TEXT_NODE &&
                                 ( $textChild->textContent == "??" || $textChild->textContent == ' ' || $textChild->textContent == '' || $textChild->textContent == '&nbsp;' ) ) )
                          {

          However, I manually applied the changes, and new tests show the issue is resolved.

          Show
          Joao Inacio (Inactive) added a comment - @Damien: The patch did not apply cleanly (special chars or copy/paste issue? In my editor(s) the following is displayed: $textChild = $lastChild->lastChild; // $textChild->textContent == "??" : string(2) whitespace in Opera if ( !$textChild || ( $lastChild->childNodes->length == 1 && $textChild->nodeType == XML_TEXT_NODE && ( $textChild->textContent == "??" || $textChild->textContent == ' ' || $textChild->textContent == '' || $textChild->textContent == '&nbsp;' ) ) ) { However, I manually applied the changes, and new tests show the issue is resolved.
          Hide
          Damien Pobel (Inactive) added a comment -

          Last questions:

          • did you test this in others browsers (against the same eZ Publish install) ? as it does not seem to related at all with IE8.
          • could you attach the PHP info page available (in http://<yoursiteaccessurl>/setup/info/php) ?
          Show
          Damien Pobel (Inactive) added a comment - Last questions: did you test this in others browsers (against the same eZ Publish install) ? as it does not seem to related at all with IE8. could you attach the PHP info page available (in http://<yoursiteaccessurl>/setup/info/php) ?
          Hide
          Joao Inacio (Inactive) added a comment -

          At least latest Chrome and Firefox did not show this behavior.

          php info attached.

          Show
          Joao Inacio (Inactive) added a comment - At least latest Chrome and Firefox did not show this behavior. php info attached.
          Show
          Damien Pobel (Inactive) added a comment - PR: https://github.com/ezsystems/ezpublish-legacy/pull/705
          Show
          Damien Pobel (Inactive) added a comment - Fixed in ezpublish-legacy: master: http://github.com/ezsystems/ezpublish-legacy/commit/36a8093f482eaff3c7c6098cf1b89e28710d68e4

            People

            • Assignee:
              Unassigned
              Reporter:
              Joao Inacio (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 2 hours, 30 minutes
                1d 2h 30m