Skip to content

Commit 2440950

Browse files
authored
Merge branch '1.9.4.x' into topic-extjs
2 parents 2f1c1a0 + 74beed6 commit 2440950

File tree

694 files changed

+1178
-31987
lines changed

Some content is hidden

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

694 files changed

+1178
-31987
lines changed

.ddev/commands/web/vendor-patches

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
## Description: create Vendor Patches
4+
## Usage: vendor-patches
5+
## Example: ddev vendor-patches
6+
7+
php vendor/bin/vendor-patches generate

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ updates:
33
- package-ecosystem: "composer"
44
directory: "/"
55
schedule:
6-
interval: "weekly"
6+
interval: "daily"
77
- package-ecosystem: "github-actions"
88
directory: "/"
99
schedule:

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
2727
restore-keys: ${{ runner.os }}-composer-
2828

29+
- name: Require legacy frontend themes on v19
30+
if: startsWith(github.event.release.tag_name, 'v19')
31+
run: composer require --no-install --prefer-dist --no-progress --ignore-platform-req=ext-* openmage/legacy-frontend-themes
32+
2933
- name: Require Mage_Backup on v19
3034
if: startsWith(github.event.release.tag_name, 'v19')
3135
run: composer require --no-install --prefer-dist --no-progress --ignore-platform-req=ext-* openmage/module-mage-backup

.htaccess

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
ExpiresByType text/x-javascript "access plus 1 month"
198198
ExpiresByType application/x-shockwave-flash "access plus 1 month"
199199
ExpiresByType image/x-icon "access plus 1 year"
200+
ExpiresByType image/svg+xml "access plus 1 year"
200201
ExpiresDefault "access plus 2 days"
201202
</IfModule>
202203

README.md

Lines changed: 65 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3-
<a href="#contributors-"><img src="https://img.shields.io/badge/all_contributors-151-orange.svg" alt="All Contributors"></a>
3+
<a href="#contributors-"><img src="https://img.shields.io/badge/all_contributors-152-orange.svg" alt="All Contributors"></a>
44
<!-- ALL-CONTRIBUTORS-BADGE:END -->
55
<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>
66
<a href="https://packagist.org/packages/openmage/magento-lts"><img src="https://poser.pugx.org/openmage/magento-lts/license.svg" alt="License"></a>
@@ -21,8 +21,8 @@ level of backwards compatibility to the official releases.
2121
## Table of contents
2222

2323
- [Requirements](#requirements)
24-
- [Optional](#optional)
2524
- [Installation](#installation)
25+
- [Manual Install](#manual-install)
2626
- [Composer](#composer)
2727
- [Git](#git)
2828
- [Secure your installation](#secure-your-installation)
@@ -36,7 +36,7 @@ level of backwards compatibility to the official releases.
3636
- [New Events](#new-events)
3737
- [Changes to SOAP/WSDL](#changes-to-soapwsdl)
3838
- [Development Environment with ddev](#development-environment-with-ddev)
39-
- [Development with PHP 8.1](#development-with-php-81)
39+
- [Development with PHP 8.1+](#development-with-php-81)
4040
- [PhpStorm Factory Helper](#phpstorm-factory-helper)
4141
- [Versioning](#versioning)
4242
- [Public Communication](#public-communication)
@@ -46,36 +46,74 @@ level of backwards compatibility to the official releases.
4646

4747
## Requirements
4848

49-
- PHP 7.3+ (PHP 8.0 is supported, PHP 8.1 is work in progress)
49+
- PHP 7.3+ (PHP 8.0 is supported, PHP 8.1 supported but some warnings may be shown/logged, PHP 8.2 is usable but still being tested)
5050
- MySQL 5.6+ (8.0+ recommended) or MariaDB
51+
- optional: Redis 5.x, 6.x and 7.0.x are supported
5152

5253

5354
- PHP extension `intl` <small>since 1.9.4.19 & 20.0.17</small>
5455
- Command `patch` 2.7+ (or `gpatch` on MacOS/HomeBrew) <small>since 1.9.5.0 & 20.1.0</small>
5556

56-
__Please be aware that although OpenMage is compatible that one or more extensions may not be.__
57-
58-
### Optional
57+
## Installation
5958

60-
- Redis 5+ (6.x recommended, latest verified compatible 6.0.7 with 20.x)
59+
### Manual Install
6160

62-
## Installation
61+
Download the latest [release archive](https://github.com/OpenMage/magento-lts/releases) and extract it over your existing install. **Important:** you must download the ZIP file from a tagged version on the releases page, otherwise there will be missing dependencies.
6362

6463
### Composer
6564

66-
Download the latest archive and extract it, clone the repo, or add a composer dependency to your existing project like so:
65+
Step 1: Create a new composer project:
6766

6867
```bash
69-
composer require "openmage/magento-lts":"^19.5.0"
68+
composer init
69+
```
70+
71+
Step 2: Configure composer. **The below options are required.** You can see all options [here](https://github.com/AydinHassan/magento-core-composer-installer#configuration).
72+
73+
```bash
74+
# Allow composer to apply patches to dependencies of magento-lts
75+
composer config --json extra.enable-patching true
76+
77+
# Configure Magento core composer installer to use magento-lts as the Magento source package
78+
composer config extra.magento-core-package-type magento-source
79+
80+
# Configure the root directory that magento-lts will be installed to, such as "pub", "htdocs", or "www"
81+
composer config extra.magento-root-dir pub
82+
```
83+
84+
Step 3: Require `magento-core-composer-installer`:
85+
86+
``` bash
87+
# PHP 7
88+
composer require "aydin-hassan/magento-core-composer-installer":"~2.0.0"
89+
90+
# PHP 8
91+
composer require "aydin-hassan/magento-core-composer-installer":"^2.1.0"
7092
```
7193

72-
To get the latest changes use:
94+
<small>Note: be sure to select `y` if composer asks you to trust `aydin-hassan/magento-core-composer-installer`.</small>
95+
96+
Step 4: Require `magento-lts`:
7397

7498
```bash
75-
composer require "openmage/magento-lts":"dev-main"
99+
# OpenMage v19
100+
composer require "openmage/magento-lts":"^19.4.0"
101+
102+
# OpenMage v20
103+
composer require "openmage/magento-lts":"^20.0.0"
76104
```
77105

78-
<small>Note: `dev-main` is just an alias for current `1.9.4.x` branch and may change</small>
106+
<small>Note: be sure to select `y` if composer asks you to trust `magento-hackathon/magento-composer-installer` or `cweagans/composer-patches`.</small>
107+
108+
To install the latest development version (may be unstable):
109+
110+
```bash
111+
# OpenMage v19
112+
composer require "openmage/magento-lts":"1.9.4.x-dev"
113+
114+
# OpenMage v20
115+
composer require "openmage/magento-lts":"20.0.x-dev"
116+
```
79117

80118
### Git
81119

@@ -129,7 +167,7 @@ Most important changes will be listed here, all other changes since `19.4.0` can
129167

130168
### Between Magento 1.9.4.5 and OpenMage 19.x
131169

132-
- bug fixes and PHP 7.x, 8.0 and 8.1 compatibility
170+
- bug fixes and PHP 7.x, 8.0, 8.1 and 8.2 compatibility
133171
- added config cache for system.xml ([#1916](https://github.com/OpenMage/magento-lts/pull/1916))
134172
- search for "NULL" in backend grids ([#1203](https://github.com/OpenMage/magento-lts/pull/1203))
135173
- removed `lib/flex` containing unused ActionScript "file uploader" files ([#2271](https://github.com/OpenMage/magento-lts/pull/2271))
@@ -145,6 +183,7 @@ Most important changes will be listed here, all other changes since `19.4.0` can
145183
_If you rely on those modules you can reinstall them with composer:_
146184
- `Mage_Backup`: `composer require openmage/module-mage-backup`
147185
- `Mage_PageCache`: `composer require openmage/module-mage-pagecache`
186+
- `Legacy frontend themes`: `composer require openmage/legacy-frontend-themes`
148187

149188
### Between OpenMage 19.4.18 / 20.0.16 and 19.4.19 / 20.0.17
150189

@@ -161,7 +200,8 @@ Do not use 20.x.x if you need IE support.
161200
- reduce needless saves by avoiding setting `_hasDataChanges` flag ([#2066](https://github.com/OpenMage/magento-lts/pull/2066))
162201
- removed support for `global/sales/old_fields_map` defined in XML ([#921](https://github.com/OpenMage/magento-lts/pull/921))
163202
- enabled website level config cache ([#2355](https://github.com/OpenMage/magento-lts/pull/2355))
164-
- make overrides of Mage_Core_Model_Resource_Db_Abstract::delete respect parent api ([#1257](https://github.com/OpenMage/magento-lts/pull/1257))
203+
- made overrides of Mage_Core_Model_Resource_Db_Abstract::delete respect parent api ([#1257](https://github.com/OpenMage/magento-lts/pull/1257))
204+
- rewrote Mage_Eav_Model_Config as cache for all eav entity and attribute reads ([#2993](https://github.com/OpenMage/magento-lts/pull/2993))
165205

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

@@ -178,14 +218,18 @@ If your project uses OpenMage through composer then all dependencies will be man
178218
If you just extracted the release zip/tarball in your project's main folder then be sure to:
179219
- remove the old copy of aforementioned libraries from your project, you can do that with this command:
180220
```bash
181-
rm -rf lib/Cm lib/Credis lib/mcryptcompat lib/Pelago lib/phpseclib lib/Zend
221+
rm -rf app/code/core/Zend lib/Cm lib/Credis lib/mcryptcompat lib/Pelago lib/phpseclib lib/Zend
182222
```
183223

184-
185224
- download the new release zip file that is named `openmage-VERSIONNUMBER.zip`, this one is built to contain the `vendor`
186225
folder generated by composer, with all the dependencies in it
187226
- extract the zip file in your project's repository as you always did
188227

228+
We also decided to remove our Zend_DB patches (that were stored in `app/code/core/Zend`) because they were very old and
229+
not compatible with the new implementations made by ZF1-Future, which is much more advanced and feature rich.
230+
This may generate a problem with `Zend_Db_Select' statements that do not use 'Zend_Db_Expr' to quote expressions.
231+
If you see SQL errors after upgrading please remember to check for this specific issue in your code.
232+
189233
### New Config Options
190234

191235
- `admin/design/use_legacy_theme`
@@ -253,11 +297,11 @@ grep -rn 'urn:Magento' --include \*.xml
253297
ddev launch
254298
```
255299

256-
## Development with PHP 8.1
300+
## Development with PHP 8.1+
257301

258302
Deprecation errors are supressed by default.
259303

260-
If you want to work on PHP 8.1 support, set environment variable `DEV_PHP_STRICT` to `1`, to show all errors.
304+
If you want to work on PHP 8.1+ support, set environment variable `DEV_PHP_STRICT` to `1`, to show all errors.
261305

262306
## PhpStorm Factory Helper
263307

@@ -501,6 +545,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
501545
<td align="center" valign="top" width="14.28%"><a href="https://github.com/discountscott"><img src="https://avatars.githubusercontent.com/u/5454596?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Scott Moore</b></sub></a></td>
502546
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rfeese"><img src="https://avatars.githubusercontent.com/u/7074181?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Roger Feese</b></sub></a></td>
503547
<td align="center" valign="top" width="14.28%"><a href="https://github.com/AGelzer"><img src="https://avatars.githubusercontent.com/u/34437931?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Alexander Gelzer</b></sub></a></td>
548+
<td align="center" valign="top" width="14.28%"><a href="https://gitlab.com/davidhiendl"><img src="https://avatars.githubusercontent.com/u/11006964?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>David Hiendl</b></sub></a></td>
504549
</tr>
505550
</tbody>
506551
</table>

api.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
2020
*/
2121

22-
if (version_compare(phpversion(), '7.3.0', '<') === true) {
23-
echo 'It looks like you have an invalid PHP version. OpenMage supports PHP 7.3.0 or newer';
24-
exit;
25-
}
26-
2722
$magentoRootDir = getcwd();
2823
$bootstrapFilename = $magentoRootDir . '/app/bootstrap.php';
2924
$mageFilename = $magentoRootDir . '/app/Mage.php';

app/Mage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public static function getOpenMageVersionInfo(): array
214214
'major' => '20',
215215
'minor' => '1',
216216
'patch' => '0',
217-
'stability' => 'rc1', // beta,alpha,rc
217+
'stability' => 'rc2', // beta,alpha,rc
218218
'number' => '', // 1,2,3,0.3.7,x.7.z.92 @see https://semver.org/#spec-item-9
219219
];
220220
}
@@ -223,7 +223,7 @@ public static function getOpenMageVersionInfo(): array
223223
'major' => '19',
224224
'minor' => '5',
225225
'patch' => '0',
226-
'stability' => 'rc1', // beta,alpha,rc
226+
'stability' => 'rc2', // beta,alpha,rc
227227
'number' => '', // 1,2,3,0.3.7,x.7.z.92 @see https://semver.org/#spec-item-9
228228
];
229229
}

app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ public function getRootByIds($ids)
132132
$tree = $categoryTreeResource->loadByIds($ids);
133133
$rootId = Mage_Catalog_Model_Category::TREE_ROOT_ID;
134134
$root = $tree->getNodeById($rootId);
135-
if ($root && $rootId != Mage_Catalog_Model_Category::TREE_ROOT_ID) {
136-
$root->setIsVisible(true);
137-
} elseif ($root && $root->getId() == Mage_Catalog_Model_Category::TREE_ROOT_ID) {
135+
if ($root && $root->getId() == Mage_Catalog_Model_Category::TREE_ROOT_ID) {
138136
$root->setName(Mage::helper('catalog')->__('Root'));
139137
}
140138

@@ -148,9 +146,7 @@ public function getNode($parentNodeCategory, $recursionLevel = 2)
148146
{
149147
$tree = Mage::getResourceModel('catalog/category_tree');
150148

151-
$nodeId = $parentNodeCategory->getId();
152-
$parentId = $parentNodeCategory->getParentId();
153-
149+
$nodeId = $parentNodeCategory->getId();
154150
$node = $tree->loadNode($nodeId);
155151
$node->loadChildren($recursionLevel);
156152

app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
3333
$_months = [];
3434
for ($i = 1; $i <= 12; $i++) {
3535
$_months[$i] = Mage::app()->getLocale()
36-
->date(mktime(null, null, null, $i))
36+
->date(mktime(0, null, null, $i))
3737
->get(Zend_Date::MONTH_NAME);
3838
}
3939

app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ public function relatedGridAction()
406406
$this->_initProduct();
407407
$this->loadLayout();
408408
$this->getLayout()->getBlock('catalog.product.edit.tab.related')
409-
->setProductsRelated($this->getRequest()->getPost('products_related', null));
409+
->setProductsRelated($this->getRequest()->getPost('products_related', []));
410410
$this->renderLayout();
411411
}
412412

@@ -419,7 +419,7 @@ public function upsellGridAction()
419419
$this->_initProduct();
420420
$this->loadLayout();
421421
$this->getLayout()->getBlock('catalog.product.edit.tab.upsell')
422-
->setProductsRelated($this->getRequest()->getPost('products_upsell', null));
422+
->setProductsUpsell($this->getRequest()->getPost('products_upsell', []));
423423
$this->renderLayout();
424424
}
425425

@@ -432,7 +432,7 @@ public function crosssellGridAction()
432432
$this->_initProduct();
433433
$this->loadLayout();
434434
$this->getLayout()->getBlock('catalog.product.edit.tab.crosssell')
435-
->setProductsRelated($this->getRequest()->getPost('products_crosssell', null));
435+
->setProductsCrossSell($this->getRequest()->getPost('products_crosssell', []));
436436
$this->renderLayout();
437437
}
438438

@@ -445,7 +445,7 @@ public function superGroupAction()
445445
$this->_initProduct();
446446
$this->loadLayout();
447447
$this->getLayout()->getBlock('catalog.product.edit.tab.super.group')
448-
->setProductsGrouped($this->getRequest()->getPost('products_grouped', null));
448+
->setProductsGrouped($this->getRequest()->getPost('products_grouped', []));
449449
$this->renderLayout();
450450
}
451451

app/code/core/Mage/Adminhtml/controllers/PollController.php

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -141,48 +141,44 @@ public function validateAction()
141141
Mage::throwException(Mage::helper('adminhtml')->__('Please, select "Visible in Stores" for this poll first.'));
142142
}
143143

144-
if (is_array($stores)) {
145-
$storeIds = [];
146-
foreach ($stores as $storeIdList) {
147-
$storeIdList = explode(',', $storeIdList);
148-
if (!$storeIdList) {
149-
continue;
150-
}
151-
foreach ($storeIdList as $storeId) {
152-
if ($storeId > 0) {
153-
$storeIds[] = $storeId;
154-
}
155-
}
144+
$storeIds = [];
145+
foreach ($stores as $storeIdList) {
146+
$storeIdList = explode(',', $storeIdList);
147+
if (!$storeIdList) {
148+
continue;
156149
}
157-
if (count($storeIds) === 0) {
158-
Mage::throwException(Mage::helper('adminhtml')->__('Please, select "Visible in Stores" for this poll first.'));
150+
foreach ($storeIdList as $storeId) {
151+
if ($storeId > 0) {
152+
$storeIds[] = $storeId;
153+
}
159154
}
160-
$pollModel->setStoreIds($storeIds);
161155
}
156+
if (count($storeIds) === 0) {
157+
Mage::throwException(Mage::helper('adminhtml')->__('Please, select "Visible in Stores" for this poll first.'));
158+
}
159+
$pollModel->setStoreIds($storeIds);
162160

163161
$answers = $this->getRequest()->getParam('answer');
164162

165163
if (!is_array($answers) || !count($answers)) {
166164
Mage::throwException(Mage::helper('adminhtml')->__('Please, add some answers to this poll first.'));
167165
}
168166

169-
if (is_array($answers)) {
170-
$_titles = [];
171-
foreach ($answers as $key => $answer) {
172-
if (in_array($answer['title'], $_titles)) {
173-
Mage::throwException(Mage::helper('adminhtml')->__('Your answers contain duplicates.'));
174-
}
175-
$_titles[] = $answer['title'];
176-
177-
$answerModel = Mage::getModel('poll/poll_answer');
178-
if ((int) $key > 0) {
179-
$answerModel->setId($key);
180-
}
181-
$answerModel->setAnswerTitle($answer['title'])
182-
->setVotesCount($answer['votes']);
167+
$_titles = [];
168+
foreach ($answers as $key => $answer) {
169+
if (in_array($answer['title'], $_titles)) {
170+
Mage::throwException(Mage::helper('adminhtml')->__('Your answers contain duplicates.'));
171+
}
172+
$_titles[] = $answer['title'];
183173

184-
$pollModel->addAnswer($answerModel);
174+
$answerModel = Mage::getModel('poll/poll_answer');
175+
if ((int) $key > 0) {
176+
$answerModel->setId($key);
185177
}
178+
$answerModel->setAnswerTitle($answer['title'])
179+
->setVotesCount($answer['votes']);
180+
181+
$pollModel->addAnswer($answerModel);
186182
}
187183

188184
$pollModel->save();

0 commit comments

Comments
 (0)