Issue Bug Rejected

#105984Inconsistent backend preview renderer behavior

Rudolf Rohaczek 01/23/25, 14:49 updated 03/24/25, 20:18

Description

My project contains a content element where i can select starting points (system folders via TCA type group). With that data i collect records from the selected folders.

I created a content element that is using the database-query data processor:

tt_content.staffmembers_storage {
    # template setup is in another location
    dataProcessing {
        10 = database-query
        10 {
            as = staffmembers
            table = tx_staff_staffmember_item
            pidInList.field = tx_staff_startingpoint
            orderBy = sorting
            dataProcessing {
                10 = files
                10 {
                    references.fieldName = image
                    as = image
                }
            }
        }
    }
}

Then i created the following setup for the backend preview:

mod.web_layout {
    tt_content {
        preview {
            staffmembers_storage = EXT:staff/Resources/Private/Templates/Preview/StaffmembersStorage.html
        }
    }
}

The output in the frontend works without problems. I get the staffmembers records and can process them as expected.

In the backend preview template i also get data output and try to access the records but there are no usable items in the “record” object. There is data in tx_staff_startingpoint but this lists only the selected folders as items. There is no sight of the desired records.

What made me create this issue is the fact that i have nearly the same content element. In this case you can select individual records (TCA type group) in the content element. This is the setup:

tt_content.staffmembers_curated {
    dataProcessing {
        10 = database-query
        10 {
            as = staffmembers
            table = tx_staff_staffmember_item
            uidInList.field = tx_staff_staffmembers
            pidInList = 0
            orderBy = sorting
            dataProcessing {
                10 = files
                10 {
                    references.fieldName = image
                    as = image
                }
            }
        }
    }
}
mod.web_layout {
    tt_content {
        preview {
            staffmembers_curated = EXT:staff/Resources/Private/Templates/Preview/StaffmembersCurated.html
        }
    }
}

With that not only the frontend output works, but also the backend preview gets the requested records in the field tx_staff_staffmembers.

Conclusion:

So in my opinion the behavior of the backend preview renderer is inconsistent/wrong in the case of the pidInList definition. Also due the fact that the frontend output is working with my typoscript setup.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.