Magento – Magento 2 Class Catalog\Model\Product\Attribute\Backend\Media does not exist

backendclassmagento-2.1.3magento2

When trying to edit or add a new product on the backend I receive the following error

Class Magento\Catalog\Model\Product\Attribute\Backend\Media does not exist.

It stops me from editing or adding a product!
This has happened after importing a few products.

Best Answer

Use these commands on the root of your installation.

alias mage="php -d memory_limit=-1 -f bin/magento"

chmod -R 775 pub/static/ var/ pub/media/ && 
rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/ vendor/* ; 
composer install && composer update -vvv && 
php -r "opcache_reset();" 
mage module:disable Magento_Review ; 
mage cache:flush && 
mage indexer:reindex && 
mage setup:upgrade && 
mage setup:static-content:deploy && 
mage setup:db-data:upgrade && 
mage dev:source-theme:deploy && 
chmod -R 775 pub/static/ pub/media/ var/