Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed Apr 29, 2023
2 parents bad757d + cefa503 commit 210aa81
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 36 deletions.
6 changes: 6 additions & 0 deletions app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@

Varien_Autoload::register();

/** AUTOLOADER PATCH **/
if (file_exists($autoloaderPath = (getenv('COMPOSER_VENDOR_PATH') ?: BP . DS . 'vendor') . DS . 'autoload.php')) {
require $autoloaderPath;
}
/** AUTOLOADER PATCH **/

/* Support additional includes, such as composer's vendor/autoload.php files */
foreach (glob(BP . DS . 'app' . DS . 'etc' . DS . 'includes' . DS . '*.php') as $path) {
include_once $path;
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Captcha/Model/Zend.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Mage_Captcha_Model_Zend extends Zend_Captcha_Image implements Mage_Captcha
/**
* Generated word
*
* @var string|null
* @var string
*/
protected $_word;

Expand Down Expand Up @@ -483,7 +483,7 @@ protected function _setWord($word)
protected function _clearWord()
{
$this->getSession()->unsetData($this->_getFormIdKey(self::SESSION_WORD));
$this->_word = null;
$this->_word = '';
return $this;
}

Expand Down
5 changes: 5 additions & 0 deletions app/code/core/Mage/Catalog/Helper/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,18 @@ protected function getImageFile()
*/
protected function parseSize($string)
{
if ($string === null) {
return false;
}

$size = explode('x', strtolower($string));
if (count($size) === 2) {
return [
'width' => ($size[0] > 0) ? $size[0] : null,
'heigth' => ($size[1] > 0) ? $size[1] : null,
];
}

return false;
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Controller/Varien/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ protected function _filterDates($array, $dateFields)
]);

foreach ($dateFields as $dateField) {
if (array_key_exists($dateField, $array) && !empty($dateField)) {
if ($dateField && !empty($array[$dateField])) {
$array[$dateField] = $filterInput->filter($array[$dateField]);
$array[$dateField] = $filterInternal->filter($array[$dateField]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class Mage_Eav_Model_Adminhtml_System_Config_Source_Inputtype_Validator extends Zend_Validate_InArray
{
/**
* @var array<string, string>|null
* @inheritdoc
*/
protected $_messageTemplates;

Expand All @@ -34,7 +34,7 @@ public function __construct()
$haystack = $helper->getInputTypesValidatorData();

//reset message template and set custom
$this->_messageTemplates = null;
$this->_messageTemplates = [];
$this->_initMessageTemplates();

//parent construct with options
Expand Down
28 changes: 23 additions & 5 deletions app/code/core/Mage/Payment/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ class Mage_Payment_Helper_Data extends Mage_Core_Helper_Abstract

protected $_moduleName = 'Mage_Payment';

/**
* Retrieve the class name of the payment method's model
*
* @param $code
* @return string|null
*/
public function getMethodModelClassName($code)
{
$key = self::XML_PATH_PAYMENT_METHODS . '/' . $code . '/model';
return Mage::getStoreConfig($key);
}

/**
* Retrieve method model object
*
Expand All @@ -34,8 +46,7 @@ class Mage_Payment_Helper_Data extends Mage_Core_Helper_Abstract
*/
public function getMethodInstance($code)
{
$key = self::XML_PATH_PAYMENT_METHODS . '/' . $code . '/model';
$class = Mage::getStoreConfig($key);
$class = $this->getMethodModelClassName($code);
if (is_null($class)) {
Mage::logException(new Exception(sprintf('Unknown payment method with code "%s"', $code)));
return false;
Expand Down Expand Up @@ -156,7 +167,13 @@ public function getRecurringProfileMethods($store = null)
{
$result = [];
foreach ($this->getPaymentMethods($store) as $code => $data) {
$method = $this->getMethodInstance($code);
$paymentMethodModelClassName = $this->getMethodModelClassName($code);
if (!$paymentMethodModelClassName) {
continue;
}

/** @var Mage_Payment_Model_Method_Abstract $method */
$method = Mage::getModel($paymentMethodModelClassName);
if ($method && $method->canManageRecurringProfiles()) {
$result[] = $method;
}
Expand Down Expand Up @@ -207,8 +224,9 @@ public function getPaymentMethodList($sorted = true, $asLabelValue = false, $wit
if ((isset($data['title']))) {
$methods[$code] = $data['title'];
} else {
if ($this->getMethodInstance($code)) {
$methods[$code] = $this->getMethodInstance($code)->getConfigData('title', $store);
$paymentMethodModelClassName = $this->getMethodModelClassName($code);
if ($paymentMethodModelClassName) {
$methods[$code] = Mage::getModel($paymentMethodModelClassName)->getConfigData('title', $store);
}
}
if ($asLabelValue && $withGroups && isset($data['group'])) {
Expand Down
2 changes: 1 addition & 1 deletion dev/openmage/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
- ../..:/var/www/html
environment:
- ENABLE_SENDMAIL=${ENABLE_SENDMAIL:-true}
- XDEBUG_CONFIG=${XDEBUG_CONFIG:-remote_connect_back=1 remote_enable=1 idekey=phpstorm}
- XDEBUG_CONFIG=${XDEBUG_CONFIG:-client_host=host.docker.internal mode=debug force_display_errors=1 start_with_request=yes}
- MAGE_IS_DEVELOPER_MODE=${MAGE_IS_DEVELOPER_MODE:-1}
links:
- mysql
Expand Down
11 changes: 0 additions & 11 deletions dev/phpstan/stubs/Zend_Captcha_Word.stub

This file was deleted.

9 changes: 0 additions & 9 deletions dev/phpstan/stubs/Zend_Validate_InArray.stub

This file was deleted.

3 changes: 0 additions & 3 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ parameters:

# Instantiated class not found
- lib/Varien/Image/Adapter.php
stubFiles:
- dev/phpstan/stubs/Zend_Captcha_Word.stub
- dev/phpstan/stubs/Zend_Validate_InArray.stub
level: 4
checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true
Expand Down
4 changes: 2 additions & 2 deletions skin/frontend/rwd/default/js/msrp_rwd.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*/

Catalog.Map.showHelp = Catalog.Map.showHelp.wrap(function (parent, event) {
var helpBox = $('map-popup');
var bodyNode = $$('body')[0];
var helpBox = document.getElementById('map-popup');
var bodyNode = document.getElementsByTagName('body')[0];

// Resolve calculation bug in parent so we can actually use these classes...
if (helpBox && this != Catalog.Map && Catalog.Map.active != this.link) {
Expand Down

0 comments on commit 210aa81

Please sign in to comment.