Port the changes from contao/core@b20d4554e7e4deb12f6ba6efb136d176770d3ec7