Port the changes from contao/core@1c6a5d9c2aaac09a7781903145a7d51943c69678