[BUGFIX] Improve subcategoryhandling

Change-Id: I243b1557f24ebd5f9de8c2e257124a0793758b89
Resolves: #49573
Reviewed-on: https://review.typo3.org/22531
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer