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

Links in table cell apply incorrectly when text has a line break

    Details

      Description

      When adding a link to a table cell, and the cell above includes a link with the text splitted by a line break, the text in the cell above after the line break is also affected.


      Steps to reproduce:

      • Create new table (1x2)
      • Insert a link in the first row on two lines of text that have been line broken using the shift key by selecting both lines of text at once. Note that the selected text when the link is applied is on the TOP line.
      • Add a second link in the second row on a single line of text

      On completion, the link will also apply to the second line of text of the link in the first row.

      After adding the link check the link above, and the same url as below has been added to it, which is wrong.

        Activity

        Hide
        Yannick Roger (Inactive) added a comment -

        Results of my investigation so far:

        Here is the structure (disable editor) without links:

        <table class="default" border="0" width="100%" custom:summary="euie" custom:caption="uie">
          <tr>
            <td>truc
        1</td>
          </tr>
          <tr>
            <td>truc2</td>
          </tr>
        </table>
        

        After the link has been added with the editor:

        <table class="default" border="0" width="100%" custom:summary="euie" custom:caption="uie">
          <tr>
            <td><link href="truc1.com">truc</link>
        <link id="__mce_tmp" href="truc1.com">1</link></td>
          </tr>
          <tr>
            <td>truc2</td>
          </tr>
        </table>
        

        the second link has

        id="__mce_tmp"

        this is most likely causing the issue. Because if you remove it before adding the second link the bug is not happening.

        Show
        Yannick Roger (Inactive) added a comment - Results of my investigation so far: Here is the structure (disable editor) without links: <table class="default" border="0" width="100%" custom:summary="euie" custom:caption="uie"> <tr> <td>truc 1</td> </tr> <tr> <td>truc2</td> </tr> </table> After the link has been added with the editor: <table class="default" border="0" width="100%" custom:summary="euie" custom:caption="uie"> <tr> <td><link href="truc1.com">truc</link> <link id="__mce_tmp" href="truc1.com">1</link></td> </tr> <tr> <td>truc2</td> </tr> </table> the second link has id="__mce_tmp" this is most likely causing the issue. Because if you remove it before adding the second link the bug is not happening.
        Show
        Joao Inacio (Inactive) added a comment - PR: https://github.com/ezsystems/ezpublish-legacy/pull/1166
        Show
        Damien Pobel (Inactive) added a comment - Alternative PR: https://github.com/ezsystems/ezpublish-legacy/pull/1176
        Show
        Yannick Roger (Inactive) added a comment - Fixed in master: https://github.com/ezsystems/ezpublish-legacy/commit/1b16164a13a614df794a46d2d4afa499165ed96c
        Hide
        Miguel das Neves Jacinto (Inactive) added a comment - - edited

        @[~yannick.roger@ez.no] the fix is to making the first line, instead of the second, of the first row to have the link of the second row, this doesn't seem right.

        Show
        Miguel das Neves Jacinto (Inactive) added a comment - - edited @ [~yannick.roger@ez.no] the fix is to making the first line, instead of the second, of the first row to have the link of the second row, this doesn't seem right.
        Hide
        Yannick Roger (Inactive) added a comment -

        I tested and confirm it's not working as expected.
        With the patch:

        • the 2nd link is correct.
        • the 1st link is wrong: the first line is using the 2nd link's url and the 2nd line is correct.
        Show
        Yannick Roger (Inactive) added a comment - I tested and confirm it's not working as expected. With the patch: the 2nd link is correct. the 1st link is wrong: the first line is using the 2nd link's url and the 2nd line is correct.
        Show
        Damien Pobel (Inactive) added a comment - Additional PR: https://github.com/ezsystems/ezpublish-legacy/pull/1178
        Show
        Damien Pobel (Inactive) added a comment - Additional fix in: https://github.com/ezsystems/ezpublish-legacy/commit/0a440d4421a0d1c96f1f592dd5ed792534f912fc
        Hide
        Rui Silva (Inactive) added a comment -

        Tested and approved by QA for 5.1, 5.2, 5.3, 5.4 and master.

        Show
        Rui Silva (Inactive) added a comment - Tested and approved by QA for 5.1, 5.2, 5.3, 5.4 and master.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ricardo Correia (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: