Project

General

Profile

Bug #87521

Updated by Jarvis H over 5 years ago

h2. What causes cause the error: 

 In order to ensure correct sorting of gridelements-children in the Menu Section element I used the Typoscript found below. 
 Basically joining tt_content on tt_content will cause an error reading "Column 'l18n_parent' in where clause is ambiguous". 

 <pre> 
 tt_content.menu_section { 
     dataProcessing { 
         10 { 
             dataProcessing { 
                 20 { 

                     # Adjust query params in dataProcessor for correct 
                     # sorting of elements inside grids 
                     table = tt_content 
                     selectFields = tt_content.*, COALESCE(tt2.sorting, tt_content.sorting) AS sort 
                     pidInList.field = uid 
                     as = content 
                     where = tt_content.sectionIndex = 1 
                     leftjoin = tt_content AS tt2 ON tt2.uid = tt_content.tx_gridelements_container 
                     orderBy = sort ASC 
                 } 
             } 
         } 
     } 
 } 
 </pre> 

 h2. Possible solution: 

 In the class @TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer@ and function @getLanguageRestriction()@ adjusting the following part starting on line 7032: 

 <pre><code class="php"> 
 if ($includeRecordsWithoutDefaultTranslation) { 
     $languageQuery = $expressionBuilder->orX( 
         $languageQuery, 
         $expressionBuilder->andX( 
             $expressionBuilder->eq($localizationParentField, 0), 
             $expressionBuilder->eq($languageField, $languageAspect->getContentId()) 
          ) 
     ); 
 } 
 </code></pre> 

 to this: 

 <pre><code class="php"> 
 if ($includeRecordsWithoutDefaultTranslation) { 
     $languageQuery = $expressionBuilder->orX( 
         $languageQuery, 
         $expressionBuilder->andX( 
             // add $table prefix to $localizationParentField 
             $expressionBuilder->eq($table . '.' . $localizationParentField, 0), 
             $expressionBuilder->eq($languageField, $languageAspect->getContentId()) 
          ) 
     ); 
 } 
 </code></pre> 

 solves the issue for me.

Back