Port the changes from contao/core@cf9d69cf5d775615dea3af2d2d428386219e3312