45 \
Magento\Framework\UrlInterface $urlBuilder,
46 \
Magento\Framework\
App\Config\ValueFactory $configValueFactory
48 $this->_urlBuilder = $urlBuilder;
51 $this->_configValueFactory = $configValueFactory;
59 protected function _getConfigUrl()
62 $defaultUnsecure = $this->_config->getValue(Store::XML_PATH_UNSECURE_BASE_URL,
'default');
64 $defaultSecure = $this->_config->getValue(Store::XML_PATH_SECURE_BASE_URL,
'default');
66 if ($defaultSecure == \
Magento\
Store\Model\Store::BASE_URL_PLACEHOLDER ||
67 $defaultUnsecure == \
Magento\
Store\Model\Store::BASE_URL_PLACEHOLDER
69 $output = $this->_urlBuilder->getUrl(
'adminhtml/system_config/edit', [
'section' =>
'web']);
72 $dataCollection = $this->_configValueFactory->create()->getCollection();
73 $dataCollection->addValueFilter(\
Magento\Store\Model\Store::BASE_URL_PLACEHOLDER);
76 foreach ($dataCollection as
$data) {
77 if (
$data->getScope() ==
'stores') {
78 $code = $this->_storeManager->getStore(
$data->getScopeId())->getCode();
79 $output = $this->_urlBuilder->getUrl(
80 'adminhtml/system_config/edit',
81 [
'section' =>
'web',
'store' =>
$code]
85 $code = $this->_storeManager->getWebsite(
$data->getScopeId())->getCode();
86 $output = $this->_urlBuilder->getUrl(
87 'adminhtml/system_config/edit',
88 [
'section' =>
'web',
'website' =>
$code]
104 return md5(
'BASE_URL' . $this->_getConfigUrl());
114 return (
bool)$this->_getConfigUrl();
125 '{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure ' 126 .
'URL / Base Secure URL. We highly recommend changing this value in your Magento ' 127 .
'<a href="%1">configuration</a>.',
128 $this->_getConfigUrl()
elseif(isset( $params[ 'redirect_parent']))
__construct(\Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\UrlInterface $urlBuilder, \Magento\Framework\App\Config\ValueFactory $configValueFactory)