Port the changes from contao/core@441658f737aa2efc91aa7e35e68557c09c05a691