Issue Bug Closed

#78741FileCollector::addFilesFromRelation missing check for already overlayed pages

Frank Nägler 11/18/16, 11:01 updated 11/18/16, 13:13

Description

Adding file references to a translated page currently fails due to double overlaying of the pages record.
Add a check to resolve the references directly, if the page has already been overlayed, should solves the problem.

To reproduce this bug, you can use the following TypoScript:

temp.listItem = FILES
temp.listItem {
   references {
      table = pages
      fieldName = navigation_icon
   }

   maxItems = 1
   renderObj = COA
   renderObj {
      10 = IMAGE
      10 {
         params = class="img-circle"
         file {
            import.data = file:current:uid
            treatIdAsReference = 1
            width = 40
            height = 40
         }
      }

      20 = TEXT
      20.field = nav_title // title

      stdWrap.typolink {
         parameter.field = uid
      }
   }
}

lib.navigationSecondLevel = HMENU
lib.navigationSecondLevel {
   special = directory
   special.value.current = 1
   1 = TMENU
   1 {
      noBlur = 1
      wrap = <ul class="list-unstyled">|</ul>
      expAll = 1
      NO = 1
      NO.ATagTitle.field = nav_title // title
      NO.stdWrap.cObject < temp.listItem
      NO.doNotLinkIt = 1
      NO.wrapItemAndSub = <li>|</li>
   }
}

This TypoScript generates a menu with an icon/image resolved from the media field.
This works well for the default language, but not for any translated page.

The field navigation_icon is not translatable, it is set only in the default language

Reviews 1