This changeset is a follow-up to the changes for issue #50349 and
it partly reverts the changes that have been introduced back then.
The most important changes are:
* Allow early return on first found record in hasPageVersions.
The previous implementation performed SQL queries on all tables
that are defined in the global TCA array. Now the first version
occurrence is enough to infer that a page has any versions.
* Integrate hooks to modify the determined results. This way, the
meaning of having versions can be further modified by hooks.
For instance, the default behavior of the TYPO3 core is to create
a workspace version record on persisting the same record in the
backend - without any actual changes to the data model.