Skip to content

Commit

Permalink
Merge branch 'main' into feature/cache-flush-time
Browse files Browse the repository at this point in the history
  • Loading branch information
kiatng authored Feb 28, 2024
2 parents 3e3692a + 40dcee7 commit f09a0e9
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 77 deletions.
4 changes: 2 additions & 2 deletions app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public static function getOpenMageVersionInfo(): array
if (self::getOpenMageMajorVersion() === 20) {
return [
'major' => '20',
'minor' => '4',
'minor' => '5',
'patch' => '0',
'stability' => '', // beta,alpha,rc
'number' => '', // 1,2,3,0.3.7,x.7.z.92 @see https://semver.org/#spec-item-9
Expand All @@ -225,7 +225,7 @@ public static function getOpenMageVersionInfo(): array
return [
'major' => '19',
'minor' => '5',
'patch' => '2',
'patch' => '3',
'stability' => '', // beta,alpha,rc
'number' => '', // 1,2,3,0.3.7,x.7.z.92 @see https://semver.org/#spec-item-9
];
Expand Down
18 changes: 9 additions & 9 deletions app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ protected function _prepareColumns()
'index' => 'increment_id',
]);

if (!Mage::app()->isSingleStoreMode()) {
$this->addColumn('store_id', [
'header' => Mage::helper('customer')->__('Bought From'),
'index' => 'store_id',
'type' => 'store',
'store_view' => true
]);
}

$this->addColumn('created_at', [
'header' => Mage::helper('customer')->__('Purchase On'),
'index' => 'created_at',
Expand Down Expand Up @@ -99,15 +108,6 @@ protected function _prepareColumns()
'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
]);

if (!Mage::app()->isSingleStoreMode()) {
$this->addColumn('store_id', [
'header' => Mage::helper('customer')->__('Bought From'),
'index' => 'store_id',
'type' => 'store',
'store_view' => true
]);
}

if (Mage::helper('sales/reorder')->isAllow()) {
$this->addColumn('action', [
'header' => ' ',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ protected function _prepareLayout()
'after_html' => '</div>'
]);
$this->setChild('top_button', $button);
}

if ($this->getCustomerId()) {
$button = clone $button;
$button->unsId();
$this->setChild('bottom_button', $button);
}

return parent::_prepareLayout();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function _getDeleteCheckbox()
$html = '';
if ((string)$this->getValue()) {
$label = Mage::helper('adminhtml')->__('Delete File');
$html .= '<div>' . $this->getValue() . ' ';
$html .= '<div>' . Mage::helper('adminhtml')->escapeHtml($this->getValue()) . ' ';
$html .= '<input type="checkbox" name="' . parent::getName() . '[delete]" value="1" class="checkbox" id="' . $this->getHtmlId() . '_delete"' . ($this->getDisabled() ? ' disabled="disabled"' : '') . '/>';
$html .= '<label for="' . $this->getHtmlId() . '_delete"' . ($this->getDisabled() ? ' class="disabled"' : '') . '> ' . $label . '</label>';
$html .= '<input type="hidden" name="' . parent::getName() . '[value]" value="' . $this->getValue() . '" />';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Mage_Adminhtml_Block_System_Config_Form_Field_Heading extends Mage_Adminht
*/
public function render(Varien_Data_Form_Element_Abstract $element)
{
$useContainerId = $element->getData('use_container_id');
return sprintf(
'<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4 id="%s">%s</h4></td></tr>',
$element->getHtmlId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function getValue($key, $default = '', $defaultNew = null)
}

$value = $this->getData($key);
return $this->escapeHtml(strlen($value) > 0 ? $value : $default);
return $this->escapeHtml($value !== null && strlen($value) > 0 ? $value : $default);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Block/Product/List.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Mage_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_Abstrac
/**
* Product Collection
*
* @var Mage_Eav_Model_Entity_Collection_Abstract|null
* @var Mage_Catalog_Model_Resource_Product_Collection|null
*/
protected $_productCollection;

Expand Down
3 changes: 2 additions & 1 deletion app/code/core/Mage/Dataflow/Model/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ protected function _beforeSave()
{
parent::_beforeSave();
$actionsXML = $this->getData('actions_xml');
if (strlen($actionsXML) < 0 &&
// @phpstan-ignore-next-line because of https://github.com/phpstan/phpstan/issues/10570
if ($actionsXML !== null && strlen($actionsXML) < 0 &&
@simplexml_load_string('<data>' . $actionsXML . '</data>', null, LIBXML_NOERROR) === false
) {
Mage::throwException(Mage::helper('dataflow')->__("Actions XML is not valid."));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public function getRowUrl($row)
* Prepare collection by setting page number, sorting etc..
*
* @param Mage_Eav_Model_Resource_Entity_Attribute_Collection $collection
* @return Mage_Eav_Model_Resource_Entity_Attribute_Collection
* @return Mage_Core_Model_Resource_Db_Collection_Abstract|null
*/
public function prepareCollection(Mage_Eav_Model_Resource_Entity_Attribute_Collection $collection)
{
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/mage/adminhtml/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var Variables = {
title:'Insert Variable...',
width:700,
//height:270,
zIndex:1000,
zIndex:9000,
recenterAuto:false,
hideEffect:Element.hide,
showEffect:Element.show,
Expand Down
4 changes: 2 additions & 2 deletions js/mage/adminhtml/wysiwyg/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var widgetTools = {
top:50,
width:950,
//height:450,
zIndex:1000,
zIndex:9000,
recenterAuto:false,
hideEffect:Element.hide,
showEffect:Element.show,
Expand Down Expand Up @@ -354,7 +354,7 @@ WysiwygWidget.chooser.prototype = {
top:50,
width:950,
height:500,
zIndex:1000,
zIndex:9000,
recenterAuto:false,
hideEffect:Element.hide,
showEffect:Element.show,
Expand Down
44 changes: 44 additions & 0 deletions lib/Varien/Data/Form/Element/Info.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* OpenMage
*
* 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 at https://opensource.org/license/osl-3-0-php
*
* @category Varien
* @package Varien_Data
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/**
* @category Varien
* @package Varien_Data
*/
class Varien_Data_Form_Element_Info extends Varien_Data_Form_Element_Abstract
{
/**
* @param array $attributes
*/
public function __construct($attributes = [])
{
parent::__construct($attributes);
$this
->setType('info')
->unsScope()
->unsCanUseDefaultValue()
->unsCanUseWebsiteValue();
}

/**
* @return string
*/
public function getHtml()
{
$id = $this->getHtmlId();
$label = $this->getLabel();
$html = '<tr class="' . $id . '"><td class="label" colspan="99"><label>' . $label . '</label></td></tr>';
return $html;
}
}
45 changes: 0 additions & 45 deletions phpstan.dist.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,6 @@ parameters:
count: 2
path: app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php

-
message: "#^Right side of && is always true\\.$#"
count: 2
path: app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php

-
message: "#^Variable \\$billingAddress might not be defined\\.$#"
count: 2
Expand Down Expand Up @@ -1210,11 +1205,6 @@ parameters:
count: 1
path: app/code/core/Mage/Catalog/Block/Product/Compare/List.php

-
message: "#^Method Mage_Catalog_Block_Product_List\\:\\:_getProductCollection\\(\\) should return Mage_Catalog_Model_Resource_Product_Collection but returns Mage_Eav_Model_Entity_Collection_Abstract\\.$#"
count: 1
path: app/code/core/Mage/Catalog/Block/Product/List.php

-
message: "#^Property Mage_Catalog_Block_Product_List_Crosssell\\:\\:\\$_itemCollection \\(Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Link_Product_Collection\\) does not accept Mage_Catalog_Model_Resource_Product_Link_Product_Collection\\.$#"
count: 1
Expand Down Expand Up @@ -2925,16 +2915,6 @@ parameters:
count: 1
path: app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php

-
message: "#^Comparison operation \"\\<\" between int\\<0, max\\> and 0 is always false\\.$#"
count: 1
path: app/code/core/Mage/Dataflow/Model/Profile.php

-
message: "#^Result of && is always false\\.$#"
count: 1
path: app/code/core/Mage/Dataflow/Model/Profile.php

-
message: "#^Right side of && is always true\\.$#"
count: 1
Expand Down Expand Up @@ -4490,11 +4470,6 @@ parameters:
count: 1
path: app/code/core/Mage/Sales/Model/Quote/Item.php

-
message: "#^Negated boolean expression is always true\\.$#"
count: 1
path: app/code/core/Mage/Sales/Model/Quote/Item.php

-
message: "#^Return type \\(void\\) of method Mage_Sales_Model_Quote_Item\\:\\:__clone\\(\\) should be compatible with return type \\(\\$this\\(Mage_Sales_Model_Quote_Item_Abstract\\)\\) of method Mage_Sales_Model_Quote_Item_Abstract\\:\\:__clone\\(\\)$#"
count: 1
Expand Down Expand Up @@ -4690,11 +4665,6 @@ parameters:
count: 1
path: app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php

-
message: "#^If condition is always false\\.$#"
count: 1
path: app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php

-
message: "#^Comparison operation \"\\<\" between \\(array\\|float\\|int\\) and float results in an error\\.$#"
count: 1
Expand Down Expand Up @@ -5190,11 +5160,6 @@ parameters:
count: 1
path: app/code/core/Mage/Weee/Model/Tax.php

-
message: "#^If condition is always false\\.$#"
count: 1
path: app/code/core/Mage/Weee/Model/Total/Quote/Weee.php

-
message: "#^PHPDoc type Mage_Weee_Helper_Data of property Mage_Weee_Model_Total_Quote_Weee\\:\\:\\$_helper is not covariant with PHPDoc type Mage_Tax_Helper_Data of overridden property Mage_Tax_Model_Sales_Total_Quote_Tax\\:\\:\\$_helper\\.$#"
count: 1
Expand Down Expand Up @@ -5240,11 +5205,6 @@ parameters:
count: 1
path: app/code/core/Mage/Wishlist/Helper/Data.php

-
message: "#^Negated boolean expression is always true\\.$#"
count: 1
path: app/code/core/Mage/Wishlist/Model/Item.php

-
message: "#^Method Mage_Wishlist_Model_Item_Option\\:\\:__clone\\(\\) with return type void returns \\$this\\(Mage_Wishlist_Model_Item_Option\\) but should not return anything\\.$#"
count: 1
Expand Down Expand Up @@ -5395,11 +5355,6 @@ parameters:
count: 1
path: lib/Varien/Data/Collection/Db.php

-
message: "#^Empty array passed to foreach\\.$#"
count: 1
path: lib/Varien/Data/Collection/Filesystem.php

-
message: "#^Property Varien_Data_Form_Abstract\\:\\:\\$_elements \\(Varien_Data_Form_Element_Collection\\) in empty\\(\\) is not falsy\\.$#"
count: 1
Expand Down
4 changes: 0 additions & 4 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ parameters:
- lib/Varien
- shell
excludePaths:
# removed and fixed modules (OM-2811, OM-2813)
- app/code/core/Mage/Backup/*
- app/code/core/Mage/PageCache/*

#incompatible interfaces
- app/code/core/Mage/Admin/Model/Acl/Assert/Ip.php
- app/code/core/Mage/Admin/Model/Acl/Assert/Time.php
Expand Down
2 changes: 1 addition & 1 deletion skin/adminhtml/default/default/boxes.css
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ select.multiselect option { padding:3px 4px; border-bottom:1px solid #ddd;
.form-list td.hidden { border:0 !important; padding:0 !important; background:0 !important; }
.form-list td.label { width:200px; }
.form-list td.use-default label { display:inline-block; vertical-align:middle; padding:0 3px; }
.form-list td.label label { display:block; width:185px; padding-right:15px; padding-top:1px; }
.form-list td.label label { display:block; padding-right:15px; padding-top:1px; }
.form-list td.value input.input-text,
.form-list td.value textarea { width:274px; }
.form-list td.value textarea { height:15em; }
Expand Down

0 comments on commit f09a0e9

Please sign in to comment.