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

embeding image not working correctly when more than one image attribute in a class

    XMLWordPrintable

Details

    Description

      In design/standard/javascript/ezoe/popup_utils.js there's this code:

                         if ( n.image_attributes && n.data_map[ n.image_attributes[0] ] && n.data_map[ n.image_attributes[0] ].content['small'] )
                         {
                             tag = document.createElement("span");
                             tag.className = 'image_preview';
                             tag.innerHTML += ' <a href="#">' + ed.getLang('preview.preview_desc')  + '<img src="' + ed.settings.ez_root_url + n.data_map[ n.image_$
                             td.appendChild( tag );
                             hasImage = true;
                         }
      

      So only the the first image attribute is checked and if it's empty hasImage is not set to true.
      Therefore if we have a image class that has for example two image attributes:

      • thumb
      • image

      an we have an object of this class which has image uploaded in the image attribute and the thumb is empty, this object cannot be embed in OE as image.

      The code should be changed so that it searches all the image attributes until it finds one that is not empty.

      Steps to reproduce
      • add an image attribute to the image class
      • create an object of the image where only the second image atribute has an image uploaded
      • try to embed that object into OE as image

      Attachments

        Activity

          People

            ls ls
            zmak zmak
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: