Port the changes from contao/core@454d47505d48256f93459967143fbe28110a8f28