Cherry-pick adapted pull request from shopware/shopware@894dd89e1a6ac7f2f0f83eb40bbe6a0261f44135