Skip to content

Commit ac8880e

Browse files
committed
Merge branch '1.9.4.x' into phpstan/update-1
# Conflicts: # phpstan.dist.baseline.neon
2 parents 180bb97 + 9e6ac30 commit ac8880e

File tree

43 files changed

+172
-300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+172
-300
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ Do not use 20.x.x if you need IE support.
130130
- removed module `Mage_PageCache` [#2258](https://github.com/OpenMage/magento-lts/pull/2258)
131131
- removed lib/flex containing unused ActionScript "file uploader" files [#2271](https://github.com/OpenMage/magento-lts/pull/2271)
132132
- enabled website level config cache [#2355](https://github.com/OpenMage/magento-lts/pull/2355)
133+
- make overrides of Mage_Core_Model_Resource_Db_Abstract::delete respect parent api [#1257](https://github.com/OpenMage/magento-lts/pull/1257)
133134

134135
For full list of changes, you can [compare tags](https://github.com/OpenMage/magento-lts/compare/1.9.4.x...20.0).
135136

app/Mage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ public static function getBaseUrl($type = Mage_Core_Model_Store::URL_TYPE_LINK,
433433
/**
434434
* Generate url by route and parameters
435435
*
436-
* @param string $route
436+
* @param null|string $route
437437
* @param array $params
438438
* @return string
439439
*/

app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Form.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ protected function _prepareForm()
6262
'required' => true,
6363
'name' => 'store_ids[]',
6464
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(),
65-
'value' => Mage::registry('poll_data')->getStoreIds(),
66-
'after_element_html' => Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml()
65+
'value' => Mage::registry('poll_data')->getStoreIds()
6766
]);
6867
} else {
6968
$fieldset->addField('store_ids', 'hidden', [

app/code/core/Mage/Adminhtml/Block/Store/Switcher.php

Lines changed: 32 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@
2828
*/
2929
class Mage_Adminhtml_Block_Store_Switcher extends Mage_Adminhtml_Block_Template
3030
{
31-
/**
32-
* Key in config for store switcher hint
33-
*/
34-
public const XPATH_HINT_KEY = 'store_switcher';
35-
3631
/**
3732
* @var array
3833
*/
@@ -45,13 +40,6 @@ class Mage_Adminhtml_Block_Store_Switcher extends Mage_Adminhtml_Block_Template
4540
*/
4641
protected $_storeVarName = 'store';
4742

48-
/**
49-
* Url for store switcher hint
50-
*
51-
* @var string
52-
*/
53-
protected $_hintUrl;
54-
5543
/**
5644
* @var bool
5745
*/
@@ -67,6 +55,8 @@ public function __construct()
6755
}
6856

6957
/**
58+
* @return Mage_Core_Model_Resource_Website_Collection
59+
* @throws Mage_Core_Exception
7060
* @deprecated
7161
*/
7262
public function getWebsiteCollection()
@@ -100,6 +90,8 @@ public function getWebsites()
10090
}
10191

10292
/**
93+
* @param Mage_Core_Model_Website|int|string $website
94+
* @return Mage_Core_Model_Resource_Store_Group_Collection
10395
* @deprecated
10496
*/
10597
public function getGroupCollection($website)
@@ -113,7 +105,7 @@ public function getGroupCollection($website)
113105
/**
114106
* Get store groups for specified website
115107
*
116-
* @param Mage_Core_Model_Website $website
108+
* @param Mage_Core_Model_Website|int|string|null $website
117109
* @return array
118110
*/
119111
public function getStoreGroups($website)
@@ -125,6 +117,8 @@ public function getStoreGroups($website)
125117
}
126118

127119
/**
120+
* @param Mage_Core_Model_Store_Group|int|string $group
121+
* @return Mage_Core_Model_Resource_Store_Collection
128122
* @deprecated
129123
*/
130124
public function getStoreCollection($group)
@@ -143,7 +137,7 @@ public function getStoreCollection($group)
143137
/**
144138
* Get store views for specified store group
145139
*
146-
* @param Mage_Core_Model_Store_Group $group
140+
* @param Mage_Core_Model_Store_Group|int|string|null $group
147141
* @return array
148142
*/
149143
public function getStores($group)
@@ -162,6 +156,9 @@ public function getStores($group)
162156
return $stores;
163157
}
164158

159+
/**
160+
* @return string
161+
*/
165162
public function getSwitchUrl()
166163
{
167164
if ($url = $this->getData('switch_url')) {
@@ -170,33 +167,54 @@ public function getSwitchUrl()
170167
return $this->getUrl('*/*/*', ['_current' => true, $this->_storeVarName => null]);
171168
}
172169

170+
/**
171+
* @param string $varName
172+
* @return $this
173+
*/
173174
public function setStoreVarName($varName)
174175
{
175176
$this->_storeVarName = $varName;
176177
return $this;
177178
}
178179

180+
/**
181+
* @return mixed
182+
* @throws Exception
183+
*/
179184
public function getStoreId()
180185
{
181186
return $this->getRequest()->getParam($this->_storeVarName);
182187
}
183188

189+
/**
190+
* @param array $storeIds
191+
* @return $this
192+
*/
184193
public function setStoreIds($storeIds)
185194
{
186195
$this->_storeIds = $storeIds;
187196
return $this;
188197
}
189198

199+
/**
200+
* @return array
201+
*/
190202
public function getStoreIds()
191203
{
192204
return $this->_storeIds;
193205
}
194206

207+
/**
208+
* @return bool
209+
*/
195210
public function isShow()
196211
{
197212
return !Mage::app()->isSingleStoreMode();
198213
}
199214

215+
/**
216+
* @return string
217+
*/
200218
protected function _toHtml()
201219
{
202220
if (!Mage::app()->isSingleStoreMode()) {
@@ -218,38 +236,4 @@ public function hasDefaultOption($hasDefaultOption = null)
218236
}
219237
return $this->_hasDefaultOption;
220238
}
221-
222-
/**
223-
* Return url for store switcher hint
224-
*
225-
* @return string
226-
*/
227-
public function getHintUrl()
228-
{
229-
if ($this->_hintUrl === null) {
230-
$this->_hintUrl = Mage::helper('core/hint')->getHintByCode(self::XPATH_HINT_KEY);
231-
}
232-
return $this->_hintUrl;
233-
}
234-
235-
/**
236-
* Return store switcher hint html
237-
*
238-
* @return string
239-
*/
240-
public function getHintHtml()
241-
{
242-
$html = '';
243-
$url = $this->getHintUrl();
244-
if ($url) {
245-
$html = '<a'
246-
. ' href="' . $this->escapeUrl($url) . '"'
247-
. ' onclick="this.target=\'_blank\'"'
248-
. ' title="' . Mage::helper('core')->quoteEscape($this->__('What is this?')) . '"'
249-
. ' class="link-store-scope">'
250-
. $this->__('What is this?')
251-
. '</a>';
252-
}
253-
return $html;
254-
}
255239
}

app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,4 @@ public function render(Varien_Data_Form_Element_Abstract $element)
6060
$this->_element = $element;
6161
return $this->toHtml();
6262
}
63-
64-
/**
65-
* Return html for store switcher hint
66-
*
67-
* @return string
68-
*/
69-
public function getHintHtml()
70-
{
71-
return Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml();
72-
}
7363
}

app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset/Element.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,4 @@ public function render(Varien_Data_Form_Element_Abstract $element)
6060
$this->_element = $element;
6161
return $this->toHtml();
6262
}
63-
64-
/**
65-
* Return html for store switcher hint
66-
*
67-
* @return string
68-
*/
69-
public function getHintHtml()
70-
{
71-
return Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml();
72-
}
7363
}

app/code/core/Mage/Adminhtml/Block/System/Config/Switcher.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,4 @@ public function getStoreSelectOptions()
106106

107107
return $options;
108108
}
109-
110-
/**
111-
* Return store switcher hint html
112-
*
113-
* @return mixed
114-
*/
115-
public function getHintHtml()
116-
{
117-
return Mage::getBlockSingleton('adminhtml/store_switcher')->getHintHtml();
118-
}
119109
}

app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ public function initTabs()
125125
}
126126
}
127127

128-
Mage::helper('adminhtml')->addPageHelpUrl('/section/' . $current);
129-
130128
return $this;
131129
}
132130

app/code/core/Mage/Adminhtml/Helper/Data.php

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ class Mage_Adminhtml_Helper_Data extends Mage_Adminhtml_Helper_Help_Mapping
3636

3737
protected $_moduleName = 'Mage_Adminhtml';
3838

39+
/**
40+
* @var string
41+
* @deprecated
42+
*/
3943
protected $_pageHelpUrl;
4044

4145
/**
@@ -44,6 +48,7 @@ class Mage_Adminhtml_Helper_Data extends Mage_Adminhtml_Helper_Help_Mapping
4448
* @param null|string $url
4549
* @param null|string $suffix
4650
* @return mixed
51+
* @deprecated
4752
*/
4853
public function getPageHelpUrl($url = null, $suffix = null)
4954
{
@@ -59,37 +64,11 @@ public function getPageHelpUrl($url = null, $suffix = null)
5964
* @param null|string $url
6065
* @param null|string $suffix
6166
* @return $this
67+
* @deprecated
6268
*/
6369
public function setPageHelpUrl($url = null, $suffix = null)
6470
{
65-
if (is_null($url)) {
66-
$request = Mage::app()->getRequest();
67-
$frontModule = $request->getControllerModule();
68-
if (!$frontModule) {
69-
$frontName = $request->getModuleName();
70-
$router = Mage::app()->getFrontController()->getRouterByFrontName($frontName);
71-
72-
$frontModule = $router->getModuleByFrontName($frontName);
73-
if (is_array($frontModule)) {
74-
$frontModule = $frontModule[0];
75-
}
76-
}
77-
$url = "http://merch.docs.magento.com/{$this->getHelpTargetVersion()}/user_guide/";
78-
79-
$moduleName = $frontModule;
80-
$controllerName = $request->getControllerName();
81-
$actionName = $request->getActionName() . (!is_null($suffix) ? $suffix : '');
82-
83-
if ($mappingUrl = $this->findInMapping($moduleName, $controllerName, $actionName)) {
84-
$url .= $mappingUrl;
85-
} else {
86-
$url = 'http://magento.com/help/documentation';
87-
}
88-
89-
$this->_pageHelpUrl = $url;
90-
}
9171
$this->_pageHelpUrl = $url;
92-
9372
return $this;
9473
}
9574

@@ -98,18 +77,27 @@ public function setPageHelpUrl($url = null, $suffix = null)
9877
*
9978
* @param string $suffix
10079
* @return $this
80+
* @deprecated
10181
*/
10282
public function addPageHelpUrl($suffix)
10383
{
10484
$this->_pageHelpUrl = $this->getPageHelpUrl(null, $suffix);
10585
return $this;
10686
}
10787

88+
/**
89+
* @param string $route
90+
* @param array $params
91+
* @return string
92+
*/
10893
public static function getUrl($route = '', $params = [])
10994
{
11095
return Mage::getModel('adminhtml/url')->getUrl($route, $params);
11196
}
11297

98+
/**
99+
* @return false|int
100+
*/
113101
public function getCurrentUserId()
114102
{
115103
if (Mage::getSingleton('admin/session')->getUser()) {

app/code/core/Mage/Adminhtml/Model/Email/Template.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public function getSystemConfigPathsWhereUsedAsDefault()
4545
if (!$templateCode) {
4646
return [];
4747
}
48-
$paths = [];
4948

49+
$paths = [];
5050
$configSections = Mage::getSingleton('adminhtml/config')->getSections();
5151

5252
// find nodes which are using $templateCode value
@@ -76,13 +76,13 @@ public function getSystemConfigPathsWhereUsedCurrently()
7676
if (!$templateId) {
7777
return [];
7878
}
79-
$paths = [];
8079

80+
$paths = [];
8181
$configSections = Mage::getSingleton('adminhtml/config')->getSections();
8282

8383
// look for node entries in all system.xml that use source_model=adminhtml/system_config_source_email_template
8484
// they are will be templates, what we try find
85-
$sysCfgNodes = $configSections->xpath(self::XML_PATH_TEMPLATE_EMAIL);
85+
$sysCfgNodes = $configSections->xpath(self::XML_PATH_TEMPLATE_EMAIL);
8686
if (!is_array($sysCfgNodes)) {
8787
return [];
8888
}

app/code/core/Mage/Adminhtml/etc/config.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,6 @@
219219
</input_types>
220220
</validator_data>
221221
</general>
222-
<hints>
223-
<store_switcher>
224-
<url><![CDATA[https://web.archive.org/web/20170529192915/http://docs.magento.com/m1/ce/user_guide/configuration/scope.html]]></url>
225-
<enabled>1</enabled>
226-
</store_switcher>
227-
</hints>
228222
<help>
229223
<target_version>ce</target_version>
230224
</help>

app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Mage_Cms_Model_Wysiwyg_Images_Storage extends Varien_Object
3535
/**
3636
* Config object
3737
*
38-
* @var Mage_Core_Model_Config_Element
38+
* @var Mage_Core_Model_Config_Element|Varien_Simplexml_Element|false
3939
*/
4040
protected $_config;
4141

app/code/core/Mage/Core/Model/File/Uploader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function checkAllowedExtension($extension)
108108
*
109109
* @param string $destinationFolder
110110
* @param string|null $newFileName
111-
* @return bool|void
111+
* @return array|bool
112112
* @throws Exception
113113
*/
114114
public function save($destinationFolder, $newFileName = null)

0 commit comments

Comments
 (0)