Code copied from collective.dexteritycontentmirror