Port the changes from contao/core@1da3f93282d50b6ff5bc439aee189c4fb0f503b6