Port the changes from contao/core@5e7299d80052c71919d6ec82fb42b1b2aff355a4