Port the changes from contao/core@68a98ff9c105b51cd96be7f9d7d47126f33110b1