Port the changes from contao/core@864389c9ec856f35b03733662fb37eaec2ee8051