Skip to content

Commit

Permalink
Merge branch 'next' into tinymce6
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano authored May 15, 2023
2 parents f584bfe + d468bc2 commit c32e341
Show file tree
Hide file tree
Showing 40 changed files with 200 additions and 189 deletions.
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/Resource/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function _generateCache()
Mage::app()->saveCache(
Mage::helper('core')->jsonEncode($data),
self::CACHE_ID,
[Mage_Core_Model_App::CACHE_TAG]
[Mage_Core_Model_Resource_Db_Collection_Abstract::CACHE_TAG]
);
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/Resource/Variable.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function _generateCache()
Mage::app()->saveCache(
Mage::helper('core')->jsonEncode($data),
self::CACHE_ID,
[Mage_Core_Model_App::CACHE_TAG]
[Mage_Core_Model_Resource_Db_Collection_Abstract::CACHE_TAG]
);
}

Expand Down
16 changes: 9 additions & 7 deletions app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ protected function _beforeToHtml()
'url' => $this->getUrl('*/*/wishlist', ['_current' => true]),
]);

/** @var Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter $block */
$block = $this->getLayout()->createBlock('adminhtml/customer_edit_tab_newsletter');
if (Mage::getSingleton('admin/session')->isAllowed('newsletter/subscriber')) {
$this->addTab('newsletter', [
'label' => Mage::helper('customer')->__('Newsletter'),
'content' => $block->initForm()->toHtml()
]);
if (Mage::helper('core')->isModuleOutputEnabled('Mage_Newsletter')) {
/** @var Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter $block */
$block = $this->getLayout()->createBlock('adminhtml/customer_edit_tab_newsletter');
if (Mage::getSingleton('admin/session')->isAllowed('newsletter/subscriber')) {
$this->addTab('newsletter', [
'label' => Mage::helper('customer')->__('Newsletter'),
'content' => $block->initForm()->toHtml()
]);
}
}

if (Mage::getSingleton('admin/session')->isAllowed('catalog/reviews_ratings')) {
Expand Down
29 changes: 17 additions & 12 deletions app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ public function getOrder()
*/
protected function _beforeToHtml()
{
if ($this->getParentBlock() && ($order = $this->getOrder())) {
$this->setEntity($order);
if (Mage::helper('core')->isModuleOutputEnabled('Mage_Giftmessage')) {
if ($this->getParentBlock() && ($order = $this->getOrder())) {
$this->setEntity($order);
}
return parent::_beforeToHtml();
} else {
return parent::_beforeToHtml();
}
return parent::_beforeToHtml();
}

/**
Expand All @@ -63,15 +67,16 @@ protected function _beforeToHtml()
*/
protected function _prepareLayout()
{
$this->setChild(
'save_button',
$this->getLayout()->createBlock('adminhtml/widget_button')
->setData([
'label' => Mage::helper('giftmessage')->__('Save Gift Message'),
'class' => 'save'
])
);

if (Mage::helper('core')->isModuleOutputEnabled('Mage_Giftmessage')) {
$this->setChild(
'save_button',
$this->getLayout()->createBlock('adminhtml/widget_button')
->setData([
'label' => Mage::helper('giftmessage')->__('Save Gift Message'),
'class' => 'save'
])
);
}
return $this;
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Captcha/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
<mode>after_fail</mode>
<forms>backend_forgotpassword</forms>
<failed_attempts_login>3</failed_attempts_login>
<failed_attempts_ip>1000</failed_attempts_ip>
<failed_attempts_ip>10</failed_attempts_ip>
<timeout>7</timeout>
<length>4-5</length>
<symbols>ABCDEFGHJKMnpqrstuvwxyz23456789</symbols>
Expand Down
21 changes: 17 additions & 4 deletions app/code/core/Mage/Captcha/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,22 @@
</depends>
<frontend_class>required-entry validate-digits</frontend_class>
</failed_attempts_login>
<failed_attempts_ip translate="label">
<label>Number of Unsuccessful Attempts to Login per IP Address</label>
<frontend_type>text</frontend_type>
<sort_order>6</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<depends>
<mode>after_fail</mode>
<enable>1</enable>
</depends>
<frontend_class>required-entry validate-digits</frontend_class>
</failed_attempts_ip>
<timeout translate="label">
<label>CAPTCHA Timeout (minutes)</label>
<sort_order>6</sort_order>
<sort_order>7</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
Expand All @@ -89,7 +102,7 @@
<length translate="label comment">
<label>Number of Symbols</label>
<comment>Please specify 8 symbols at the most. Range allowed (e.g. 3-5)</comment>
<sort_order>7</sort_order>
<sort_order>8</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
Expand All @@ -99,7 +112,7 @@
<symbols translate="label comment">
<label>Symbols Used in CAPTCHA</label>
<comment><![CDATA[Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.<br />Similar looking characters (e.g. "i", "l", "1") decrease chance of correct recognition by customer.]]></comment>
<sort_order>8</sort_order>
<sort_order>9</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
Expand All @@ -110,7 +123,7 @@
<label>Case Sensitive</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>9</sort_order>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
Expand Down
14 changes: 14 additions & 0 deletions app/code/core/Mage/Catalog/Helper/Product/Flat.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,20 @@ public function isAddChildData()
return (int) Mage::getConfig()->getNode(self::XML_NODE_ADD_CHILD_DATA);
}

/**
* Enable Catalog Product Flat
*
* @param bool $save
*/
public function enableFlatCollection($save = false)
{
if ($save) {
$this->_forceFlatStatusOld = $this->_forceFlatStatus;
}

$this->_forceFlatStatus = false;
}

/**
* Disable Catalog Product Flat
*
Expand Down
3 changes: 3 additions & 0 deletions app/code/core/Mage/Catalog/Model/Resource/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ protected function _getLoadAttributesSelect($object, $table)
->from(['attr_table' => $table], [])
->where("attr_table.{$this->getEntityIdField()} = ?", $object->getId())
->where('attr_table.store_id IN (?)', $storeIds);
if (count($storeIds) > 1) {
$select->order('attr_table.store_id ASC');
}
if ($setId) {
$select->join(
['set_table' => $this->getTable('eav/entity_attribute')],
Expand Down
6 changes: 0 additions & 6 deletions app/code/core/Mage/Core/Model/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ class Mage_Core_Model_App

public const DISTRO_LOCALE_CODE = 'en_US';

/**
* Cache tag for all cache data exclude config cache
*
*/
public const CACHE_TAG = 'MAGE';

/**
* Default store Id (for install)
*/
Expand Down
9 changes: 1 addition & 8 deletions app/code/core/Mage/Core/Model/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,6 @@ public function save($data, $id, $tags = [], $lifeTime = null)
return true;
}

/**
* Add global magento cache tag to all cached data exclude config cache
*/
if (!in_array(Mage_Core_Model_Config::CACHE_TAG, $tags)) {
$tags[] = Mage_Core_Model_App::CACHE_TAG;
}
return $this->getFrontend()->save((string)$data, $this->_id($id), $this->_tags($tags), $lifeTime);
}

Expand Down Expand Up @@ -427,8 +421,7 @@ public function clean($tags = [])
}
$res = $this->getFrontend()->clean($mode, $this->_tags($tags));
} else {
$res = $this->getFrontend()->clean($mode, [Mage_Core_Model_App::CACHE_TAG]);
$res = $res && $this->getFrontend()->clean($mode, [Mage_Core_Model_Config::CACHE_TAG]);
$this->flush();
}
return $res;
}
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Core/Model/Design/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Mage_Core_Model_Design_Package
/**
* Package theme
*
* @var string
* @var array
*/
protected $_theme;

Expand Down Expand Up @@ -242,7 +242,7 @@ public function setTheme()
{
switch (func_num_args()) {
case 1:
foreach (['layout', 'template', 'skin', 'locale'] as $type) {
foreach (['layout', 'template', 'skin', 'locale', 'default'] as $type) {
$this->_theme[$type] = func_get_arg(0);
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ protected function _saveCache($data, $select)
protected function _getCacheTags()
{
$tags = parent::_getCacheTags();
$tags[] = Mage_Core_Model_App::CACHE_TAG;
$tags[] = self::CACHE_TAG;
return $tags;
}
Expand Down
2 changes: 2 additions & 0 deletions app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ public function loadByCode($entityType, $code)
$this->_getResource()->loadByCode($this, $entityTypeId, $code);
}
$this->_afterLoad();
$this->setOrigData();
$this->_hasDataChanges = false;
Varien_Profiler::stop('_LOAD_ATTRIBUTE_BY_CODE__');
return $this;
}
Expand Down
17 changes: 11 additions & 6 deletions app/code/core/Mage/Log/Model/Visitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,22 @@ public function __construct(array $data = [])
protected function _construct()
{
$this->_init('log/visitor');
$userAgent = $this->_httpHelper->getHttpUserAgent();
if ($this->_logCondition->isLogDisabled()) {
$this->_skipRequestLogging = true;
return;
}

$ignoreAgents = $this->_config->getNode('global/ignore_user_agents');
if ($ignoreAgents) {
$ignoreAgents = $ignoreAgents->asArray();
if (in_array($userAgent, $ignoreAgents)) {
$this->_skipRequestLogging = true;
$userAgent = $this->_httpHelper->getHttpUserAgent();
foreach ($ignoreAgents as $ignoreAgent) {
if (stripos($userAgent, $ignoreAgent) !== false) {
$this->_skipRequestLogging = true;
break;
}
}
}
if ($this->_logCondition->isLogDisabled()) {
$this->_skipRequestLogging = true;
}
}

/**
Expand Down
25 changes: 22 additions & 3 deletions app/code/core/Mage/Log/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,28 @@
</entities>
</ignoredModules>
<ignore_user_agents>
<google1>Googlebot/1.0 (googlebot@googlebot.com http://googlebot.com/)</google1>
<google2>Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)</google2>
<google3>Googlebot/2.1 (+http://www.googlebot.com/bot.html)</google3>
<adsbot>AdsBot</adsbot>
<alphabot>AlphaBot</alphabot>
<amazonbot>Amazonbot</amazonbot>
<bingbot>bingbot</bingbot>
<blexbot>BLEXBot</blexbot>
<dotbot>DotBot</dotbot>
<facebookexternalhit>facebookexternalhit</facebookexternalhit>
<google>Googlebot</google>
<google-site-verification>Google-Site-Verification</google-site-verification>
<hrefsbot>AhrefsBot</hrefsbot>
<istellabot>istellabot</istellabot>
<mauibot>MauiBot</mauibot>
<mj12bot>MJ12bot</mj12bot>
<mod_pagespeed>mod_pagespeed</mod_pagespeed>
<opensiteexplorer>spbot</opensiteexplorer>
<pinterestbot>Pinterestbot</pinterestbot>
<semrushbot>SemrushBot</semrushbot>
<seotester>SEOTesterBot</seotester>
<yandexbot>YandexBot</yandexbot>
<yandeximage>YandexImages</yandeximage>
<yandexmobilebot>YandexMobileBot</yandexmobilebot>
<zoominfobot>ZoominfoBot</zoominfobot>
</ignore_user_agents>
<helpers>
<log>
Expand Down
1 change: 1 addition & 0 deletions app/code/core/Mage/Page/Block/Html/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public function getLogoSrc()

/**
* @return string
* @deprecated Use SVG or srcset
*/
public function getLogoSrcSmall()
{
Expand Down
14 changes: 7 additions & 7 deletions app/code/core/Mage/Page/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,21 @@
<default>
<design>
<head translate="default_description" module="page">
<default_title>Magento Commerce</default_title>
<default_title>OpenMage</default_title>
<default_description>Default Description</default_description>
<default_keywords>Magento, Varien, E-commerce</default_keywords>
<default_keywords>OpenMage, e-commerce</default_keywords>
<default_robots>*</default_robots>
<default_media_type>text/html</default_media_type>
<default_charset>utf-8</default_charset>
</head>
<header translate="welcome" module="page">
<logo_src>images/logo.gif</logo_src>
<logo_alt>Magento Commerce</logo_alt>
<logo_src_small>images/logo.gif</logo_src_small>
<welcome>Default welcome msg!</welcome>
<logo_src>images/logo.svg</logo_src>
<logo_alt>OpenMage</logo_alt>
<logo_src_small>images/logo.svg</logo_src_small>
<welcome>Welcome!</welcome>
</header>
<footer translate="copyright" module="page">
<copyright>&amp;copy; 2020 OpenMage Demo Store. All Rights Reserved.</copyright>
<copyright>&amp;copy; 2023 OpenMage Demo Store. All Rights Reserved.</copyright>
</footer>
</design>
<system>
Expand Down
Loading

0 comments on commit c32e341

Please sign in to comment.