Port the changes from contao/core@34f251813474898b54aba3f975384b30675d87c7