IchHabRecht / mask_export

Export your mask elements as extension
GNU General Public License v2.0
45 stars 27 forks source link

Error "Array to string conversion" #201

Open dogawaf opened 1 year ago

dogawaf commented 1 year ago

On a php8 system, a backend preview template triggers an error "Array to string conversion"

This is triggered with this kind of setup:

tt_content with an inline field table_A, foreign_table=table_A
table A has a selectField with foreign_table=table_B, maxItems=1

The generated fluid preview:

<f:for each="{processedRow.table_A}" as="item">
    <ul>
        <li>
            <f:translate key="LLL:EXT:site_content_elements/Resources/Private/Language/locallang_db.xlf:table_A.table_B" /> {item.table_B} (id={item.uid})<br/>
        </li>
    </ul>
</f:for>

Here, {item.table_B} is an array, which leads to an error. Before php 8, fluid displayed Array.

\IchHabRecht\MaskExport\CodeGenerator\BackendFluidCodeGenerator::getInlineFluid should be fixed, I tried to recall getSelectFluid() from there, but it was not convincing...