Port the changes from contao/core@8a92317c3bfe3d99186252eec520c30050dc53cc