Port the changes from contao/core@1dbcbdf497d953177ebe6d8368669ad5a536de27