Feature #88985
closedAdd more descriptive message than "There are no records on this page" on a page with more record types
100%
Description
Having a page with multiple records of different types (say ext:news, together with tt_content) and you delete all items of any record type, the information message you get from \TYPO3\CMS\Recordlist\Controller\RecordListController::main is "There are no records on this page"
$flashMessage = GeneralUtility::makeInstance(
FlashMessage::class,
$lang->getLL('noRecordsOnThisPage'),
'',
FlashMessage::INFO
);
/** @var \TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService */
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
/** @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue $defaultFlashMessageQueue */
$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
$defaultFlashMessageQueue->enqueue($flashMessage);
Since this page may have more records of other types that message is not really true. (It does not have records of type %s any more)
In \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::generateList the htmlCode gets generated and checked of course only for this table you currently selected is having any records. The result is null, and therefore the information text is displayed.
Steps to reproduce:
1) Create page and create multiple records of different record types (example ext:news and normal content elements living in tt_content)
2) In Web->List view select you want to see only records of type X
3) Delete all records (via clipboard manager or deleted one by one)
4) You will see the information message "There are no records on this page"
Debugging:
Use GeneralUtility::_GP('table') to get the wanted table name, normalize it (somehow) and printf it to the information message.
Or \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::generateList knows the wanted tablename(s), too.
// Checking if the table should be rendered:
// Checks that we see only permitted/requested tables:
if ($this->table && $tableName !== $this->table
|| $this->tableList && !GeneralUtility::inList($this->tableList, $tableName)
|| !$backendUser->check('tables_select', $tableName)
) {
$hideTable = true;
}
Updated by Gerrit Code Review about 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61902
Updated by Gerrit Code Review about 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61902
Updated by Gerrit Code Review about 5 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61904
Updated by Gerrit Code Review about 5 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61902
Updated by Gerrit Code Review about 5 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61902
Updated by Gerrit Code Review about 5 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61902
Updated by Gerrit Code Review about 5 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61926
Updated by Pascal Querner about 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d1793e5932f33dfd135f1edf86a76ef4ddef7856.
Updated by Gerrit Code Review about 5 years ago
- Status changed from Resolved to Under Review
Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61926
Updated by Pascal Querner about 5 years ago
- Status changed from Under Review to Resolved
Applied in changeset 48c603a7ee76d0bfaf4509ba17b1fd4fadc0f639.
Updated by Benni Mack almost 5 years ago
- Status changed from Resolved to Closed