Port the changes from contao/core@44ad53bb68be74eff3ebadaa9242956f4452a370