Magento – Call to undefined method Magento\Customer\Api\Data\CustomerExtension::getIsSubscribed()

extension-attributesintegration-testmagento2.2testing

I'm getting an error Call to undefined method Magento\Customer\Api\Data\CustomerExtension::getIsSubscribed() when running integration tests on my local development environment.

For some reason it seems that some extension attributes are not generated. In this case, Magento_Newsletter should add getIsSubscribed() method to CustomerExtension, but the method is missing. Any ideas why this is happening?

Log output:

Call to undefined method Magento\Customer\Api\Data\CustomerExtension::getIsSubscribed()
 /var/www/html/vendor/magento/module-newsletter/Model/Plugin/CustomerPlugin.php:157
 /var/www/html/vendor/magento/framework/Interception/Interceptor.php:146
 /var/www/html/vendor/magento/framework/Interception/Interceptor.php:153
 /var/www/html/generated/code/Magento/Customer/Model/ResourceModel/CustomerRepository/Interceptor.php:52

Best Answer

It seems Magento_Newsletter mudule is disabled for your site. Just enable it and run setup:upgrade