Port the changes from contao/core@f89777809100fdf25528549878375790fd3d7963