Port the changes from contao/core@fe1f0e90ef1fadabe07c152e64fdae79d020e46f