Port the changes from contao/core@9075e7c1c8cf027da76eb4b0cd0f83a0b2e6bb83