Port the changes from contao/core@f080d8881ae225935689655faaeb12fc720148cc