Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved phpseclib, mcrypt_compat, Cm_RedisSession, Cm_Cache_Backend_Redis and Pelago_Emogrifier to composer #2411

Merged
merged 33 commits into from
Dec 3, 2022
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4381e83
Moved 3rd party libs to composer
fballiano Aug 11, 2022
ad9aac6
removed unused plugin
fballiano Aug 11, 2022
87a9ec5
removing autoloader patch
fballiano Aug 12, 2022
8cf3140
forced net_idna2 to a specific commit version
fballiano Aug 15, 2022
082fb4d
updated
fballiano Aug 15, 2022
27497e6
Replaced Net_IDNA with a more maintained polyfill
fballiano Aug 16, 2022
b6e8dde
Added scripts and deploy strategy
fballiano Aug 16, 2022
1f6d90d
partial rollback
fballiano Aug 16, 2022
5e76ce3
Merge branch '1.9.4.x' into composer_modules
fballiano Aug 22, 2022
a06ba6a
recalculated composer.lock
fballiano Aug 22, 2022
1d9a889
added cleanup script
fballiano Aug 24, 2022
e9bc022
Merge branch '1.9.4.x' into composer_modules
fballiano Aug 24, 2022
6f72b8f
dropped composer lock
fballiano Aug 28, 2022
fc15369
Merge branch '1.9.4.x' into composer_modules
fballiano Aug 28, 2022
1cdfc30
Merge branch '1.9.4.x' into composer_modules
fballiano Aug 28, 2022
e906adc
merge 19.4.x
fballiano Sep 26, 2022
e3d99a9
Removed Net IDN since ext-intl is now required
fballiano Sep 26, 2022
f1813f8
Restored 1.9.4.x version
fballiano Sep 26, 2022
ae1adc4
Restored 1.9.4.x version
fballiano Sep 26, 2022
f24e251
Merge branch '1.9.4.x' into composer_modules
fballiano Sep 26, 2022
fc9164c
Merge branch '1.9.4.x' into composer_modules
fballiano Sep 27, 2022
54fd649
addedcomposer lock
fballiano Sep 27, 2022
b5361a8
addedcomposer emogrifier
fballiano Sep 27, 2022
12db77c
Removed Pelago from our repo
fballiano Sep 27, 2022
038c445
Updated Emogrifier syntax for 6.0
fballiano Sep 27, 2022
0fe52e6
Merge branch '1.9.4.x' into composer_modules
fballiano Sep 28, 2022
6c2ab63
removed vendor cleaner plugin
fballiano Sep 28, 2022
21cc192
merged 1.9.4.x and regenerated composer.lock
fballiano Oct 30, 2022
4d05153
merged 1.9.4.x
fballiano Nov 15, 2022
3afe28d
Merge branch '1.9.4.x' into composer_modules
fballiano Nov 16, 2022
31430d0
merged 1.9.4.x and regenerated composer.lock
fballiano Dec 1, 2022
c39d1af
Merge branch '1.9.4.x' into composer_modules
fballiano Dec 2, 2022
ffaf954
updated composer
fballiano Dec 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merged 1.9.4.x
Fabrizio Balliano committed Nov 15, 2022
commit 4d05153b79cf35e723a00c678f200e57c4e9e6c2
1 change: 1 addition & 0 deletions .github/phpstan.neon
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ includes:
- ../vendor/macopedia/phpstan-magento1/extension.neon
- phpstan-baseline.neon
parameters:
phpVersion: 80000 # PHP 8.0
magentoRootPath: %currentWorkingDirectory%
paths:
- %currentWorkingDirectory%/app/code/core/Mage
4 changes: 4 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -6,9 +6,13 @@ on:
push:
paths:
- '**.php'
- '.github/phpstan*'
- '.github/workflows/phpstan*'
pull_request:
paths:
- '**.php'
- '.github/phpstan*'
- '.github/workflows/phpstan*'
# Allow manually triggering the workflow.
workflow_dispatch:

4 changes: 3 additions & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -6,9 +6,11 @@ on:
push:
paths:
- '**.php'
- '.github/workflows/phpunit*'
pull_request:
paths:
- '**.php'
- '.github/workflows/phpunit*'
# Allow manually triggering the workflow.
workflow_dispatch:

@@ -23,7 +25,7 @@ jobs:
path: ./

- name: Validate composer
run: composer validate --strict
run: composer validate

- name: Get composer cache directory
id: composer-cache
2 changes: 2 additions & 0 deletions .github/workflows/syntax-php.yml
Original file line number Diff line number Diff line change
@@ -7,10 +7,12 @@ on:
paths:
- '**.php'
- '**.phtml'
- '.github/workflows/syntax-php.yml'
pull_request:
paths:
- '**.php'
- '**.phtml'
- '.github/workflows/syntax-php.yml'
# Allow manually triggering the workflow.
workflow_dispatch:

2 changes: 2 additions & 0 deletions .github/workflows/syntax-xml.yml
Original file line number Diff line number Diff line change
@@ -6,9 +6,11 @@ on:
push:
paths:
- '**.xml'
- '.github/workflows/syntax-xml.yml'
pull_request:
paths:
- '**.xml'
- '.github/workflows/syntax-xml.yml'
# Allow manually triggering the workflow.
workflow_dispatch:

4 changes: 2 additions & 2 deletions app/Mage.php
Original file line number Diff line number Diff line change
@@ -222,7 +222,7 @@ public static function getOpenMageVersionInfo()
return [
'major' => '20',
'minor' => '0',
'patch' => '16',
'patch' => '17',
'stability' => '', // beta,alpha,rc
'number' => '', // 1,2,3,0.3.7,x.7.z.92 @see https://semver.org/#spec-item-9
];
@@ -231,7 +231,7 @@ public static function getOpenMageVersionInfo()
return [
'major' => '19',
'minor' => '4',
'patch' => '18',
'patch' => '19',
'stability' => '', // beta,alpha,rc
'number' => '', // 1,2,3,0.3.7,x.7.z.92 @see https://semver.org/#spec-item-9
];
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/etc/config.xml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
<config>
<modules>
<Mage_Admin>
<version>1.6.1.3</version>
<version>1.6.1.4</version>
</Mage_Admin>
</modules>
<global>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* OpenMage
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
*
* @category Mage
* @package Mage_Admin
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

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

$obsoleteAcl = [
'admin/page_cache',
'admin/system/config/moneybookers',
'admin/system/extensions',
'admin/system/extensions/local',
'admin/system/extensions/custom',
'admin/system/tools/backup',
'admin/system/tools/backup/rollback',
'admin/system/tools/compiler',
'admin/xmlconnect',
'admin/xmlconnect/mobile',
'admin/xmlconnect/admin_connect',
'admin/xmlconnect/queue',
'admin/xmlconnect/history',
'admin/xmlconnect/templates'
];


$installer->getConnection()->delete(
$installer->getTable('admin/rule'),
['resource_id IN (?)' => $obsoleteAcl]
);

$installer->endSetup();
Original file line number Diff line number Diff line change
@@ -101,6 +101,10 @@ protected function _initCreditmemo($update = false)
$orderId = $this->getRequest()->getParam('order_id');
if ($creditmemoId) {
$creditmemo = Mage::getModel('sales/order_creditmemo')->load($creditmemoId);
if (!$creditmemo->getId()) {
$this->_getSession()->addError($this->__('The credit memo no longer exists.'));
return false;
}
} elseif ($orderId) {
$data = $this->getRequest()->getParam('creditmemo');
$order = Mage::getModel('sales/order')->load($orderId);
@@ -193,7 +197,7 @@ public function viewAction()
$this->_setActiveMenu('sales/order')
->renderLayout();
} else {
$this->_forward('noRoute');
$this->_redirect('*/*');
}
}

Original file line number Diff line number Diff line change
@@ -53,6 +53,10 @@ protected function _initShipment()
$orderId = $this->getRequest()->getParam('order_id');
if ($shipmentId) {
$shipment = Mage::getModel('sales/order_shipment')->load($shipmentId);
if (!$shipment->getId()) {
$this->_getSession()->addError($this->__('The shipment no longer exists.'));
return false;
}
} elseif ($orderId) {
$order = Mage::getModel('sales/order')->load($orderId);

@@ -133,7 +137,7 @@ public function viewAction()
$this->_setActiveMenu('sales/order')
->renderLayout();
} else {
$this->_forward('noRoute');
$this->_redirect('*/*/');
}
}

Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ public function saveAction()
$session = Mage::getSingleton('adminhtml/session');
/** @var Mage_Adminhtml_Model_Session $session */

$groups = $this->getRequest()->getPost('groups');
$groups = $this->getRequest()->getPost('groups', []);

if (isset($_FILES['groups']['name']) && is_array($_FILES['groups']['name'])) {
/**
@@ -180,7 +180,10 @@ public function saveAction()
Mage::dispatchEvent("admin_system_config_changed_section_{$section}",
['website' => $website, 'store' => $store]
);
$session->addSuccess(Mage::helper('adminhtml')->__('The configuration has been saved.'));

if (!empty($groups)) {
$session->addSuccess(Mage::helper('adminhtml')->__('The configuration has been saved.'));
}
}
catch (Mage_Core_Exception $e) {
foreach(explode("\n", $e->getMessage()) as $message) {
2 changes: 1 addition & 1 deletion app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ public function run()
if ($this->getController()->getRequest()->getParam('wsdl') !== null) {
$this->wsdlConfig->setHandler($this->getHandler())
->init();

$this->getController()->getResponse()
->clearHeaders()
->setHeader('Content-Type', 'text/xml; charset='.$apiConfigCharset)
11 changes: 7 additions & 4 deletions app/code/core/Mage/Captcha/Block/Captcha.php
Original file line number Diff line number Diff line change
@@ -37,9 +37,12 @@ class Mage_Captcha_Block_Captcha extends Mage_Core_Block_Template
*/
protected function _toHtml()
{
$blockPath = Mage::helper('captcha')->getCaptcha($this->getFormId())->getBlockName();
$block = $this->getLayout()->createBlock($blockPath);
$block->setData($this->getData());
return $block->toHtml();
if (Mage::helper('captcha')->isEnabled()) {
$blockPath = Mage::helper('captcha')->getCaptcha($this->getFormId())->getBlockName();
$block = $this->getLayout()->createBlock($blockPath);
$block->setData($this->getData());
return $block->toHtml();
}
return '';
}
}
2 changes: 1 addition & 1 deletion app/code/core/Mage/Captcha/Block/Captcha/Zend.php
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ public function getRefreshUrl()
*/
protected function _toHtml()
{
if ($this->getCaptchaModel()->isRequired()) {
if (Mage::helper('captcha')->isEnabled() && $this->getCaptchaModel()->isRequired()) {
$this->getCaptchaModel()->generate();
return parent::_toHtml();
}
10 changes: 10 additions & 0 deletions app/code/core/Mage/Captcha/Helper/Data.php
Original file line number Diff line number Diff line change
@@ -56,6 +56,16 @@ class Mage_Captcha_Helper_Data extends Mage_Core_Helper_Abstract
*/
protected $_captcha = [];

/**
* @return bool
* @since 19.4.19 / 20.0.17
*/
public function isEnabled(): bool
{
$path = Mage::app()->getStore()->isAdmin() ? 'admin/captcha/enable' : 'customer/captcha/enable';
return Mage::getStoreConfigFlag($path);
}

/**
* Get Captcha
*
16 changes: 8 additions & 8 deletions app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php
Original file line number Diff line number Diff line change
@@ -143,9 +143,9 @@ public function addCollectionData(
}

$nodeIds = [];
foreach ($this->getNodes() as $node) {
if (!in_array($node->getId(), $exclude)) {
$nodeIds[] = $node->getId();
foreach ($this->getNodes() as $id => $node) {
if (!in_array($id, $exclude)) {
$nodeIds[] = $id;
}
}
$collection->addIdFilter($nodeIds);
@@ -167,14 +167,14 @@ public function addCollectionData(
$collection->load();

foreach ($collection as $category) {
if ($this->getNodeById($category->getId())) {
$this->getNodeById($category->getId())
->addData($category->getData());
$node = $this->getNodeById($category->getId());
if ($node) {
$node->addData($category->getData());
}
}

foreach ($this->getNodes() as $node) {
if (!$collection->getItemById($node->getId()) && $node->getParent()) {
foreach ($this->getNodes() as $id => $node) {
if (!$collection->getItemById($id) && $node->getParent()) {
$this->removeNode($node);
}
}
6 changes: 3 additions & 3 deletions app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
Original file line number Diff line number Diff line change
@@ -156,7 +156,7 @@ public function start($sessionName = null)
if (Mage::app()->getFrontController()->getRequest()->isSecure() && empty($cookieParams['secure'])) {
$secureCookieName = $this->getSessionName() . '_cid';
$cookieValue = $cookie->get($secureCookieName);

// Migrate old cookie from 'frontend'
if ( ! $cookieValue
&& $sessionName === \Mage_Core_Controller_Front_Action::SESSION_NAMESPACE
@@ -167,7 +167,7 @@ public function start($sessionName = null)
$cookie->set($secureCookieName, $cookieValue);
$cookie->delete('frontend_cid');
}

// Set secure cookie check value in session if not yet set
if (!isset($_SESSION[self::SECURE_COOKIE_CHECK_KEY])) {
$cookieValue = Mage::helper('core')->getRandomString(16);
@@ -569,7 +569,7 @@ public function getValidatorData()

return $parts;
}

/**
* @return array
*/
2 changes: 1 addition & 1 deletion app/code/core/Mage/Eav/Model/Entity/Abstract.php
Original file line number Diff line number Diff line change
@@ -985,7 +985,7 @@ protected function _loadModelAttributes($object)
} else {
$select = $selects;
}

$values = $this->_getReadAdapter()->fetchAll($select);
foreach ($values as $valueRow) {
$this->_setAttributeValue($object, $valueRow);
4 changes: 2 additions & 2 deletions app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php
Original file line number Diff line number Diff line change
@@ -165,7 +165,7 @@ protected function _initSelect()
if ($this->getEntity()->getEntityTable() === Mage_Eav_Model_Entity::DEFAULT_ENTITY_TABLE && $this->getEntity()->getTypeId()) {
$this->addAttributeToFilter('entity_type_id', $this->getEntity()->getTypeId());
}

return $this;
}

@@ -1128,7 +1128,7 @@ public function _loadAttributes($printQuery = false, $logQuery = false)
} else {
$select = $selects;
}

$values = $this->getConnection()->fetchAll($select);
} catch (Exception $e) {
Mage::printException($e, $select);
22 changes: 9 additions & 13 deletions app/code/core/Mage/Newsletter/Model/Subscriber.php
Original file line number Diff line number Diff line change
@@ -359,20 +359,16 @@ public function subscribe($email)

$this->setIsStatusChanged(true);

try {
$this->save();
if ($isConfirmNeed === true
&& $isOwnSubscribes === false
) {
$this->sendConfirmationRequestEmail();
} else {
$this->sendConfirmationSuccessEmail();
}

return $this->getStatus();
} catch (Exception $e) {
throw new Exception($e->getMessage());
$this->save();
if ($isConfirmNeed === true
&& $isOwnSubscribes === false
) {
$this->sendConfirmationRequestEmail();
} else {
$this->sendConfirmationSuccessEmail();
}

return $this->getStatus();
}

/**
2 changes: 1 addition & 1 deletion app/code/core/Mage/SalesRule/Model/Observer.php
Original file line number Diff line number Diff line change
@@ -154,7 +154,7 @@ public function sales_order_paymentCancel($observer)
$rule->setTimesUsed($rule->getTimesUsed() - 1);
$rule->save();
}

if ($customerId = $order->getCustomerId()) {
// Decrement coupon_usage times_used
Mage::getResourceModel('salesrule/coupon_usage')->updateCustomerCouponTimesUsed($customerId, $coupon->getId(), true);
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ var bundleTemplateRow ='<td>' +
' <input type="hidden" name="<?php echo $this->getFieldName() ?>[{{parentIndex}}][{{index}}][delete]" value="" class="delete">' +
' {{name}}<br />' +
' <div class="nobr">' +
' <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> {{sku}}' +
' <strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> <a href="<?php echo $this->getUrl('*/catalog_product/edit', ['store' => $this->getRequest()->getParam('store')]) ?>id/{{product_id}}/">{{sku}}</a>' +
' </div>' +
'</td>' +
<?php if ($this->getCanReadPrice() !== false) : ?>
@@ -122,10 +122,14 @@ Bundle.Selection.prototype = {

var option_type = $(bOption.idLabel + '_' + parentIndex + '_type');

if(!data){
if (!data) {
var data = {};
}

if (data.selection_qty) {
data.selection_qty = parseFloat(data.selection_qty);
}

if (data.can_read_price != undefined && !data.can_read_price) {
data.selection_price_value = '';
} else {
Original file line number Diff line number Diff line change
@@ -80,10 +80,12 @@
<button type="button" onclick="window.location='<?php echo $this->getUrl('customer/address/form') ?>';" class="button"><span><span><?php echo $this->__('New Address') ?></span></span></button>
</div>
<script type="text/javascript">
//<![CDATA[
function deleteAddress(addressId) {
if(confirm('<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Are you sure you want to delete this address?')) ?>')) {
window.location='<?php echo $this->getUrl("customer/address/delete") ?>address/'+addressId;
if (confirm('<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Are you sure you want to delete this address?')) ?>')) {
window.location="<?php echo $this->getUrl('customer/address/delete') ?>address/"+addressId;
}
return false;
}
//]]>
</script>
Original file line number Diff line number Diff line change
@@ -91,8 +91,8 @@
<script type="text/javascript">
//<![CDATA[
function deleteAddress(addressId) {
if(confirm('<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Are you sure you want to delete this address?')) ?>')) {
window.location='<?php echo $this->getDeleteUrl() ?>id/'+addressId;
if (confirm('<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Are you sure you want to delete this address?')) ?>')) {
window.location="<?php echo $this->getDeleteUrl() ?>id/"+addressId;
}
return false;
}
2 changes: 2 additions & 0 deletions app/locale/en_US/Mage_Adminhtml.csv
Original file line number Diff line number Diff line change
@@ -205,8 +205,10 @@
"Cannot add tracking number.","Cannot add tracking number."
"Cannot create an invoice without products.","Cannot create an invoice without products."
"Cannot create credit memo for the order.","Cannot create credit memo for the order."
"The credit memo no longer exists.","The credit memo no longer exists."
"Cannot delete the design change.","Cannot delete the design change."
"Cannot delete tracking number.","Cannot delete tracking number."
"The shipment no longer exists.","The shipment no longer exists."
"Cannot do shipment for the order separately from invoice.","Cannot do shipment for the order separately from invoice."
"Cannot do shipment for the order.","Cannot do shipment for the order."
"Cannot initialize shipment for adding tracking number.","Cannot initialize shipment for adding tracking number."
2 changes: 1 addition & 1 deletion lib/Varien/Io/File.php
Original file line number Diff line number Diff line change
@@ -760,7 +760,7 @@ public function ls($grep=null)
}

$list_item['text'] = $entry;
$list_item['mod_date'] = date (Varien_Date::DATETIME_PHP_FORMAT, filectime($fullpath));
$list_item['mod_date'] = date(Varien_Date::DATETIME_PHP_FORMAT, filectime($fullpath));
$list_item['permissions'] = $this->_parsePermissions(fileperms($fullpath));
$list_item['owner'] = $this->_getFileOwner($fullpath);

You are viewing a condensed version of this merge commit. You can view the full changes here.