Port the changes from contao/core@cbe855e509423943766f64cc1ebbc95e69aa06d1