Port the changes from contao/core@13103bdb484ebade589ed5d5ec1fb5989ae1de37