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

Double <a> tag when adding a link to an inline image

    Details

      Description

      the the inline image template(extension/ezwebin/design/ezwebin/override/templates/embed-inline/image.tpl) adds a <a> tag if the "$link_parameters.href" variable is present.
      That result in a double <a> tag when a link is added to an inline image.

      <!-- START: including template: design/standard/templates/content/datatype/view/ezxmltags/link.tpl (design:content/datatype/view/ezxmltags/link.tpl) -->
      <a href="/jpn/Discussion-Forum" target="_self">
       
      <!-- START: including template: design/standard/templates/content/datatype/view/ezxmltags/embed-inline.tpl (design:content/datatype/view/ezxmltags/embed-inline.tpl) -->
       
      <!-- START: including template: extension/ezwebin/design/ezwebin/override/templates/embed-inline/image.tpl (design:content/view/embed-inline.tpl) -->
      <a href="/jpn/Discussion-Forum" target="_self"><img src="/var/ezflow_site/storage/images/media/images/church/453-1-jpn-JP/church_medium.jpg" alt="" /></a>
      <!-- STOP: including template: extension/ezwebin/design/ezwebin/override/templates/embed-inline/image.tpl (design:content/view/embed-inline.tpl) -->
      

      Steps to reproduce

      Use ezwebin or ezflow.
      1/ make a new content object with a xml block
      2/ add an inline image
      3/ select the image and add a link

      the rendered page will have a first link tag from design/standard/templates/content/datatype/view/ezxmltags/link.tpl, and a second one from extension/ezwebin/design/ezwebin/override/templates/embed-inline/image.tpl

        Activity

        Hide
        Sebastian Blank added a comment -

        I confirm the bug in 4.4

        Show
        Sebastian Blank added a comment - I confirm the bug in 4.4
        Hide
        Benjamin Plaquevent added a comment -

        Confirmed on community 2012.1 too.

        I found in initHandlerEmbed function of kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php at line 363 :

        if ( isset( $parentParams['link_parameters'] ) )
        $linkParameters = $parentParams['link_parameters'];
        else
        $linkParameters = array();

        If I comment out the 3 first lines, it works as expected.
        But I'm not sure not to break somthing elsewhere.
        Is there a reason to set $linkParameters to the parent's one ?

        Show
        Benjamin Plaquevent added a comment - Confirmed on community 2012.1 too. I found in initHandlerEmbed function of kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php at line 363 : if ( isset( $parentParams ['link_parameters'] ) ) $linkParameters = $parentParams ['link_parameters'] ; else $linkParameters = array(); If I comment out the 3 first lines, it works as expected. But I'm not sure not to break somthing elsewhere. Is there a reason to set $linkParameters to the parent's one ?
        Hide
        Benjamin Plaquevent added a comment - - edited

        OK, I think I understand the way it works now :

        • for embed objects, le link is applied in the embed.tpl template in order to ensure not to apply a link on a block HTML element and the <a> tag enclosing the embed object is removed.
        • for embed-inline objects, the enclosing <a> tag is not removed. So we obtain two <a> tags...
        Show
        Benjamin Plaquevent added a comment - - edited OK, I think I understand the way it works now : for embed objects, le link is applied in the embed.tpl template in order to ensure not to apply a link on a block HTML element and the <a> tag enclosing the embed object is removed. for embed-inline objects, the enclosing <a> tag is not removed. So we obtain two <a> tags...

          People

          • Assignee:
            unknown
            Reporter:
            es@ez.no
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: