I have been using Magento2 for quite a few months now and it’s always good to learn new things and share my experience with other developers.
I recently tried to remove an image from a configurable product and I received an error telling me that ‘The image cannot be removed as it has been assigned to the other image role’, it was an odd message because I was sure that I unset that image and set a new image as base, small and thumbnail, however, something wasn’t still right so I did the following to fix this:
- Make sure that you are not in the DEFAULT STORE view, if that is the case, please switch to your website store view.
- Set another image as Base, thumbnail and small image.
- Now you can easily remove the image.
Please share this post with others if the solution worked for you.
What if you are in single store mode?
In that case, it’s worth checking that the correct images roles are set i.e. base, small, thumb etc. If that doesn’t resolve the issue then obviously, you’ll need to debug it in the code.
Let me know how you got on.