Port the changes from contao/core@73f7ccbd1c64b879089320abc4cf404aeb1ab3e3