Bug #97655
closedBookmark for new records not working properly
100%
Description
I tested this with sys_categories, ext:news and tt_content. When opening a new record and saving the current view in a bookmark, it's not working properly. There is a new entry in sys_be_shortcut with my bookmark data, but it's not visible in the bookmark toolbar.
In some cases it seems to work, but actually it doesn't (see below).
I debugged a litte bit and I guess I found the issue in \TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository->initShortcuts()
For new records the type is set to "new" instead of "edit". But the the page ID of the record is stored in "recordid". On line 532 the script checks if a record with this uid exists, returns null and the bookmark is skipped. So it mistakes the storage pid for the uid.
It works when:
There is an existing record e.g. a sys_category with uid 7 and a new bookmark for a sys_category record is created on page 7. Then it uses the pid "7" to find a record of that table with uid 7. => bookmark is visible
It doesn't work when:
The new sys_category record is on page with uid "10" but there is no sys_category record with uid "10" in the system.
It's confusing, but I hope this helps.
TYPO3 11.5.10
PHP 8.0