Bug #56830
closedThumbnails in "List" module are not shown
100%
Description
I don't know since when this feature is in the core, but is quite handy to have thumbnails of images in the list module.
But the implementation in DatabaseRecordList is buggy:
// Render thumbnails, if: // - a thumbnail column exists // - there is content in it // - the thumbnail column is visible for the current type $typeColumn = $GLOBALS['TCA'][$table]['ctrl']['type']; $type = $row[$typeColumn]; $visibleColumns = $GLOBALS['TCA'][$table]['types'][$type]['showitem'];
This code fails for all tables that don't have a type column and will probably trigger some notices when it accesses $GLOBALS['TCA'][$table]['ctrl']['type']
How to test:
adding "'thumbnail' => 'images'," to the ctrl part of a table should get you a preview for the images column in the list module, if the field is shown for the current type.
If no type field is set at all, FormEngine checks for type 0 and 1 as a fallback, so this should be implemented in DatabaseRecordList as well:
// If current typeNum doesn't exist, set it to 0 (or to 1 for historical reasons, if 0 doesn't exist) if (!$GLOBALS['TCA'][$table]['types'][$typeNum]) { $typeNum = $GLOBALS['TCA'][$table]['types']['0'] ? 0 : 1; }
It is also documented in http://docs.typo3.org/typo3cms/TCAReference/Reference/Ctrl/Index.html , so fixing this is no new feature!