Skip to content

Commit

Permalink
Forward port changes from branch 1.9.4.x (30/06/2022)
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano authored Jun 30, 2022
2 parents bafc48f + 5fda298 commit e715232
Show file tree
Hide file tree
Showing 537 changed files with 9,085 additions and 2,188 deletions.
17 changes: 16 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,22 @@
"contributions": [
"code"
]
},
{
"login": "cebe",
"name": "Carsten Brandt",
"avatar_url": "https://avatars.githubusercontent.com/u/189796?v=4",
"profile": "http://cebe.cc/"
},
{
"login": "eneiasramos",
"name": "Enéias Ramos de Melo",
"avatar_url": "https://avatars.githubusercontent.com/u/2862728?v=4",
"profile": "https://github.com/eneiasramos",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7
}
}
7,460 changes: 6,980 additions & 480 deletions .github/phpstan-baseline.neon

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion .github/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ parameters:
# Dataflow/Model/Convert/Iterator.php
- */Dataflow/Model/Convert/Iterator.php

level: 0
# Too much noise from "Variable $this might not be defined"
- */app/code/core/*/*/data/*
- */app/code/core/*/*/sql/*
level: 2
checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true

# universalObjectCratesClasses:
# - Varien_Object
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: php version
run: php --version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.1']
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/static-code-analyses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
operating-system: [ubuntu-latest]
php-versions: ['7.0', '7.4']
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@master
with:
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
'.github/phpstan.neon',
]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs
- name: ensure existance of ./app/code/local
Expand All @@ -63,7 +63,7 @@ jobs:
operating-system: [ubuntu-latest]
php-versions: ['8.0','8.1']
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@master
with:
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
- directories: 'lib/'
config_files: '.github/phpstan.neon'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs
- name: ensure existance of ./app/code/local
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: OpenMage/Testfield
path: ./
Expand All @@ -22,7 +22,7 @@ jobs:
run: composer install --prefer-dist --no-progress --ignore-platform-reqs

- name: Checkout OpenMage repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: openmage

Expand Down
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
<a href="#contributors-"><img src="https://img.shields.io/badge/all_contributors-146-orange.svg?style=flat-square" alt="All Contributors"></a>
<!-- ALL-CONTRIBUTORS-BADGE:END -->
<a href="https://travis-ci.org/openmage/magento-lts"><img src="https://travis-ci.org/openmage/magento-lts.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/openmage/magento-lts"><img src="https://poser.pugx.org/openmage/magento-lts/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/openmage/magento-lts"><img src="https://poser.pugx.org/openmage/magento-lts/license.svg" alt="License"></a>
<br />
<img src="https://github.com/openmage/magento-lts/actions/workflows/php.yml/badge.svg" alt="PHP workflow Badge" />
<img src="https://github.com/openmage/magento-lts/actions/workflows/sonar.yml/badge.svg" alt="Sonar workflow badge" />
<img src="https://github.com/openmage/magento-lts/actions/workflows/static-code-analyses.yml/badge.svg" alt="Static Code Analyses workflow badge" />
<img src="https://github.com/openmage/magento-lts/actions/workflows/unit-tests.yml/badge.svg" alt="Unit Tests workflow badge" />
</p>

# Magento - Long Term Support
Expand Down Expand Up @@ -75,7 +79,8 @@ Most important changes will be listed here, all other changes since `19.4.0` can

### Between Magento 1.9.4.5 and OpenMage 19.x

Bug fixes and PHP 7.x and 8.0 compatibility.
- bug fixes and PHP 7.x and 8.0 compatibility
- added config cache for system.xml #1916

### Between OpenMage 19.x and 20.x

Expand All @@ -98,7 +103,11 @@ For full list of changes, you can [compare tags](https://github.com/OpenMage/mag
- `admin/emails/admin_notification_email_template`
- `catalog/product_image/progressive_threshold`
- `catalog/search/search_separator`
- `dev/log/max_level`
- `newsletter/security/enable_form_key`
- `sitemap/category/lastmod`
- `sitemap/page/lastmod`
- `sitemap/product/lastmod`

### New Events

Expand All @@ -111,14 +120,6 @@ For full list of changes, you can [compare tags](https://github.com/OpenMage/mag

[Full list of events](EVENTS.md)

### New Translations

There are some new or changed translations, if you want add them to your locale pack please check:

- `app/locale/en_US/Adminhtml_LTS.csv`
- `app/locale/en_US/Core_LTS.csv`
- `app/locale/en_US/Sales_LTS.csv`

### Removed Modules

- `Mage_Compiler`
Expand Down Expand Up @@ -362,6 +363,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/mdlonline"><img src="https://avatars.githubusercontent.com/u/5389528?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>mdlonline</b></sub></a></td>
<td align="center"><a href="https://www.developpeur-web-tlse.fr/"><img src="https://avatars.githubusercontent.com/u/5030086?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Benjamin MARROT</b></sub></a></td>
<td align="center"><a href="https://github.com/tmewes"><img src="https://avatars.githubusercontent.com/u/12640514?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Tino Mewes</b></sub></a></td>
<td align="center"><a href="http://cebe.cc/"><img src="https://avatars.githubusercontent.com/u/189796?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Carsten Brandt</b></sub></a><br /><a href="https://github.com/OpenMage/magento-lts/commits?author=cebe" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/eneiasramos"><img src="https://avatars.githubusercontent.com/u/2862728?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Enéias Ramos de Melo</b></sub></a></td>
</tr>
</table>

Expand Down
2 changes: 1 addition & 1 deletion api.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/

if (version_compare(phpversion(), '7.0.0', '<')===true) {
echo 'It looks like you have an invalid PHP version. Magento supports PHP 7.0.0 or newer';
echo 'It looks like you have an invalid PHP version. OpenMage supports PHP 7.0.0 or newer';
exit;
}

Expand Down
15 changes: 12 additions & 3 deletions app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ final class Mage

/**
* Gets the current Magento version string
* @link http://www.magentocommerce.com/blog/new-community-edition-release-process/
*
* @return string
*/
Expand All @@ -160,7 +159,6 @@ public static function getVersion()

/**
* Gets the detailed Magento version information
* @link http://www.magentocommerce.com/blog/new-community-edition-release-process/
*
* @return array
*/
Expand Down Expand Up @@ -404,7 +402,7 @@ public static function getModuleDir($type, $moduleName)
* Retrieve config value for store by path
*
* @param string $path
* @param mixed $store
* @param null|string|bool|int|Mage_Core_Model_Store $store
* @return mixed
*/
public static function getStoreConfig($path, $store = null)
Expand Down Expand Up @@ -865,7 +863,18 @@ public static function log($message, $level = null, $file = '', $forceLog = fals

static $loggers = array();

try {
$maxLogLevel = (int) self::getStoreConfig('dev/log/max_level');
} catch (Throwable $e) {
$maxLogLevel = Zend_Log::DEBUG;
}

$level = is_null($level) ? Zend_Log::DEBUG : $level;

if (!self::$_isDeveloperMode && $level > $maxLogLevel) {
return;
}

$file = empty($file) ?
(string) self::getConfig()->getNode('dev/log/file', Mage_Core_Model_Store::DEFAULT_CODE) : basename($file);

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/Resource/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function recordLogin(Mage_Admin_Model_User $user)
$adapter = $this->_getWriteAdapter();

$data = array(
'logdate' => now(),
'logdate' => Varien_Date::now(),
'lognum' => $user->getLognum() + 1
);

Expand Down
3 changes: 0 additions & 3 deletions app/code/core/Mage/Admin/Model/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,12 @@ class Mage_Admin_Model_Session extends Mage_Core_Model_Session_Abstract
*/
public function __construct($parameters = array())
{
/** @var Mage_Admin_Model_Redirectpolicy _urlPolicy */
$this->_urlPolicy = (!empty($parameters['redirectPolicy'])) ?
$parameters['redirectPolicy'] : Mage::getModel('admin/redirectpolicy');

/** @var Mage_Core_Controller_Response_Http _response */
$this->_response = (!empty($parameters['response'])) ?
$parameters['response'] : new Mage_Core_Controller_Response_Http();

/** @var Mage_Core_Model_Factory $user */
$this->_factory = (!empty($parameters['factory'])) ?
$parameters['factory'] : Mage::getModel('core/factory');

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ public function cleanPasswordsValidationData()
*/
protected function _getDateNow($dayOnly = false)
{
return now($dayOnly);
return Varien_Date::now($dayOnly);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/** @var $installer Mage_Core_Model_Resource_Setup */
/** @var Mage_Core_Model_Resource_Setup $installer */
$installer = $this;
$installer->startSetup();

Expand Down
48 changes: 2 additions & 46 deletions app/code/core/Mage/AdminNotification/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,6 @@
*/
class Mage_AdminNotification_Helper_Data extends Mage_Core_Helper_Abstract
{
const XML_PATH_POPUP_URL = 'system/adminnotification/popup_url';

/**
* Widget Popup Notification Object URL
*
* @var string
*/
protected $_popupUrl;

/**
* Is readable Popup Notification Object flag
*
* @var bool
*/
protected $_popupReadable;

/**
* Last Notice object
*
Expand Down Expand Up @@ -96,38 +80,10 @@ public function getUnreadNoticeCount($severity)
*
* @param bool $withExt
* @return string
* @deprecated v19.4.16
*/
public function getPopupObjectUrl($withExt = false)
{
if (is_null($this->_popupUrl)) {
$this->_popupUrl = 'https://' . Mage::getStoreConfig(self::XML_PATH_POPUP_URL);
}
return $this->_popupUrl . ($withExt ? '.swf' : '');
}

/**
* Check is readable Popup Notification Object
* @deprecated after 1.4.2.0
*
* @return bool
*/
public function isReadablePopupObject()
{
if (is_null($this->_popupReadable)) {
$this->_popupReadable = false;
$curl = new Varien_Http_Adapter_Curl();
$curl->setConfig(array(
'timeout' => 2
));
$curl->write(Zend_Http_Client::GET, $this->getPopupObjectUrl(true));
if ($curl->read()) {
if ($curl->getInfo(CURLINFO_HTTP_CODE) == 200) {
$this->_popupReadable = true;
}
}

$curl->close();
}
return $this->_popupReadable;
return '';
}
}
2 changes: 0 additions & 2 deletions app/code/core/Mage/AdminNotification/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@
<system>
<adminnotification>
<feed_url>www.openmage.org/Web_Notifications/notifications_v1.rss</feed_url>
<popup_url>widgets.magentocommerce.com/notificationPopup</popup_url>
<severity_icons_url>widgets.magentocommerce.com/%s/%s.gif</severity_icons_url>
<use_https>1</use_https>
<frequency>1</frequency>
<last_update>0</last_update>
Expand Down
2 changes: 0 additions & 2 deletions app/code/core/Mage/AdminNotification/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<groups>
<adminnotification translate="label" module="adminnotification">
<label>Notifications</label>
<frontend_type>text</frontend_type>
<sort_order>250</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
Expand All @@ -57,7 +56,6 @@
</last_update>
<feed_url>
<label>Feed Url</label>
<frontend_type>text</frontend_type>
<backend_model>adminhtml/system_config_backend_protected</backend_model>
<sort_order>3</sort_order>
<show_in_default>0</show_in_default>
Expand Down
11 changes: 3 additions & 8 deletions app/code/core/Mage/Adminhtml/Block/Api/Buttons.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,9 @@ protected function _prepareLayout()
$this->getLayout()->createBlock('adminhtml/widget_button')
->setData(array(
'label' => Mage::helper('adminhtml')->__('Delete Role'),
'onclick' => 'deleteConfirm(\''
. Mage::helper('core')->jsQuoteEscape(
Mage::helper('adminhtml')->__('Are you sure you want to do this?'),
true
)
. '\', \''
. $this->getUrlSecure('*/*/delete', array('rid' => $this->getRequest()->getParam('rid')))
. '\')',
'onclick' => 'if(confirm(\'' . Mage::helper('core')->jsQuoteEscape(
Mage::helper('adminhtml')->__('Are you sure you want to do this?')
) . '\')) roleForm.submit(\'' . $this->getUrl('*/*/delete') . '\'); return false;',
'class' => 'delete'
))
);
Expand Down
3 changes: 3 additions & 0 deletions app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function __construct()

$this->_updateButton('save', 'label', Mage::helper('adminhtml')->__('Save User'));
$this->_updateButton('delete', 'label', Mage::helper('adminhtml')->__('Delete User'));
$this->_updateButton('delete', 'onclick', 'if(confirm(\'' . Mage::helper('core')->jsQuoteEscape(
Mage::helper('adminhtml')->__('Are you sure you want to do this?')
) . '\')) editForm.submit(\'' . $this->getUrl('*/*/delete') . '\'); return false;');
}

public function getHeaderText()
Expand Down
1 change: 1 addition & 0 deletions app/code/core/Mage/Adminhtml/Block/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ protected function _prepareLayout()
);

$this->setChild('dialogs', $this->getLayout()->createBlock('adminhtml/backup_dialogs'));
return $this;
}

public function getCreateButtonHtml()
Expand Down
Loading

0 comments on commit e715232

Please sign in to comment.