I have gotten only the configuration value in the Helper file but when I put first my extension and then run setup:install command it gives this error "the default website isn’t defined. Set the website and try again."
I have applied the below code.
<?php
namespace VendoreExtensionHelper;
use MagentoStoreModelStoreManagerInterface;
class Data extends AbstractHelper
{
const SECTION_GROUP_FIELD = 'section/group/field';
protected $storeManagerInterface;
public function __construct(
Context $context,
StoreManagerInterface $storeManagerInterface
) {
$this->storeManagerInterface = $storeManagerInterface;
parent::__construct($context);
}
public function getConfigvalue()
{
return $this->scopeConfig->getValue(self::SECTION_GROUP_FIELD, ScopeInterface::SCOPE_STORE);
}
}
Any Solution regarding this Issue?
2
Answers
I’ve gotten that error mostly because Magento didn’t like my
app/etc/env.php
file. Try moving it and then runsetup:install
again to see if it finishes.You will have to append the newly created
env.php
with any customizations from your old file.remove env.php in Magento and try with upgrade