diff --git a/.github/workflows/check-files.yml b/.github/workflows/check-files.yml index e4e2b1ba150..80a04419bb5 100644 --- a/.github/workflows/check-files.yml +++ b/.github/workflows/check-files.yml @@ -71,7 +71,7 @@ jobs: - name: Get changed files id: changed-files-specific - uses: tj-actions/changed-files@v37 + uses: tj-actions/changed-files@v38 with: files: | composer.* diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Jsonrpc.php b/app/code/core/Mage/Api/Model/Server/Adapter/Jsonrpc.php index a3abe189d71..6aa4d3f7756 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Jsonrpc.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Jsonrpc.php @@ -66,7 +66,7 @@ public function getController() if (null === $controller) { $controller = new Varien_Object( - array('request' => Mage::app()->getRequest(), 'response' => Mage::app()->getResponse()) + ['request' => Mage::app()->getRequest(), 'response' => Mage::app()->getResponse()] ); $this->setData('controller', $controller); @@ -83,10 +83,33 @@ public function run() { $this->_jsonRpc = new Zend_Json_Server(); $this->_jsonRpc->setClass($this->getHandler()); + + // Allow soap_v2 style request. + $request = $this->_jsonRpc->getRequest(); + $method = $request->getMethod(); + if (!$this->_jsonRpc->getServiceMap()->getService($method)) { + // Convert request to v1 style. + $request->setMethod('call'); + $params = $request->getParams(); + $sessionId = $params[0] ?? null; + unset($params[0]); + $params = count($params) + ? [$sessionId, $method, $params] + : [$sessionId, $method]; + $request->setParams($params); + } + $this->getController()->getResponse() ->clearHeaders() ->setHeader('Content-Type', 'application/json; charset=utf8') ->setBody($this->_jsonRpc->handle()); + + Mage::dispatchEvent('api_server_adapter_jsonrpc_run_after', [ + 'method' => $method, + 'request' => $request, + 'response' => $this->_jsonRpc->getResponse() + ]); + return $this; } diff --git a/app/code/core/Mage/GoogleAnalytics/Helper/Data.php b/app/code/core/Mage/GoogleAnalytics/Helper/Data.php index 1219e345d5a..c2b9686d77d 100644 --- a/app/code/core/Mage/GoogleAnalytics/Helper/Data.php +++ b/app/code/core/Mage/GoogleAnalytics/Helper/Data.php @@ -176,13 +176,16 @@ public function isUserIdEnabled($store = null) */ public function getLastCategoryName($product): string { - $_categoryIds = $product->getCategoryIds(); - if ($_categoryIds) { - $_lastCat = array_pop($_categoryIds); - $_cat = Mage::getModel('catalog/category')->load($_lastCat); - return $_cat->getName(); - } - return ''; + $storeRootCategoryId = Mage::app()->getStore()->getRootCategoryId(); + $storeRootCategory = Mage::getModel('catalog/category')->load($storeRootCategoryId); + $lastCategory = Mage::getResourceModel('catalog/category_collection') + ->addAttributeToSelect('name') + ->addIdFilter($product->getCategoryIds()) + ->addIsActiveFilter() + ->addFieldToFilter('path', ['like' => $storeRootCategory->getPath() . "/%"]) + ->addOrder('level') + ->getFirstItem(); + return $lastCategory->getName() ?: ''; } /** diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php index 5c4c6bb14dd..b7c995d0f3e 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php @@ -526,7 +526,6 @@ public function getCode($type, $code = '') '0_FCLE' => Mage::helper('usa')->__('First-Class Mail Large Envelope'), '0_FCL' => Mage::helper('usa')->__('First-Class Mail Letter'), '0_FCSL' => Mage::helper('usa')->__('First-Class Mail Stamped Letter'), - '0_FCP' => Mage::helper('usa')->__('First-Class Package Service - Retail'), '0_FCPC' => Mage::helper('usa')->__('First-Class Mail Postcards'), '1' => Mage::helper('usa')->__('Priority Mail'), '2' => Mage::helper('usa')->__('Priority Mail Express Hold For Pickup'), @@ -569,7 +568,6 @@ public function getCode($type, $code = '') '57' => Mage::helper('usa')->__('Priority Mail Express Sunday/Holiday Delivery Flat Rate Boxes'), '58' => Mage::helper('usa')->__('Priority Mail Regional Rate Box C'), '59' => Mage::helper('usa')->__('Priority Mail Regional Rate Box C Hold For Pickup'), - '61' => Mage::helper('usa')->__('First-Class Package Service'), '62' => Mage::helper('usa')->__('Priority Mail Express Padded Flat Rate Envelope'), '63' => Mage::helper('usa')->__('Priority Mail Express Padded Flat Rate Envelope Hold For Pickup'), '64' => Mage::helper('usa')->__('Priority Mail Express Sunday/Holiday Delivery Padded Flat Rate Envelope'), @@ -599,13 +597,13 @@ public function getCode($type, $code = '') 'INT_24' => Mage::helper('usa')->__('Priority Mail International DVD Flat Rate priced box'), 'INT_25' => Mage::helper('usa')->__('Priority Mail International Large Video Flat Rate priced box'), 'INT_27' => Mage::helper('usa')->__('Priority Mail Express International Padded Flat Rate Envelope'), + '1058' => Mage::helper('usa')->__('USPS Ground Advantage'), ], 'service_to_code' => [ '0_FCLE' => 'First Class', '0_FCL' => 'First Class', '0_FCSL' => 'First Class', - '0_FCP' => 'First Class', '0_FCPC' => 'First Class', '1' => 'Priority', '2' => 'Priority Express', @@ -648,7 +646,6 @@ public function getCode($type, $code = '') '57' => 'Priority Express', '58' => 'Priority', '59' => 'Priority', - '61' => 'First Class', '62' => 'Priority Express', '63' => 'Priority Express', '64' => 'Priority Express', @@ -678,6 +675,7 @@ public function getCode($type, $code = '') 'INT_24' => 'Priority', 'INT_25' => 'Priority', 'INT_27' => 'Priority Express', + '1058' => 'Ground Advantage', ], // Added because USPS has different services but with same CLASSID value, which is "0" @@ -686,7 +684,6 @@ public function getCode($type, $code = '') 'First-Class Mail Letter' => '0_FCL', 'First-Class Mail Stamped Letter' => '0_FCSL', 'First-Class Mail Metered Letter' => '72', - 'First-Class Package Service - Retail' => '0_FCP', ], 'first_class_mail_type' => [ diff --git a/app/code/core/Mage/Usa/etc/config.xml b/app/code/core/Mage/Usa/etc/config.xml index 0abb4ca022d..8d02d4b3fa1 100644 --- a/app/code/core/Mage/Usa/etc/config.xml +++ b/app/code/core/Mage/Usa/etc/config.xml @@ -178,7 +178,7 @@ 0 0 - 0_FCLE,0_FCL,0_FCSL,0_FCP,0_FCPC,1,2,3,4,6,7,13,15,16,17,22,23,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,53,57,58,59,61,62,63,64,72,INT_1,INT_2,INT_4,INT_5,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,INT_12,INT_13,INT_14,INT_15,INT_16,INT_17,INT_18,INT_19,INT_20,INT_21,INT_22,INT_23,INT_24,INT_25,INT_27 + 0_FCLE,0_FCL,0_FCSL,0_FCPC,1,2,3,4,6,7,13,15,16,17,22,23,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,53,57,58,59,62,63,64,72,INT_1,INT_2,INT_4,INT_5,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,INT_12,INT_13,INT_14,INT_15,INT_16,INT_17,INT_18,INT_19,INT_20,INT_21,INT_22,INT_23,INT_24,INT_25,INT_27,1058 VARIABLE diff --git a/composer.lock b/composer.lock index 6ddd23e3522..632207218b6 100644 --- a/composer.lock +++ b/composer.lock @@ -984,16 +984,16 @@ }, { "name": "shardj/zf1-future", - "version": "1.23.2", + "version": "1.23.5", "source": { "type": "git", "url": "https://github.com/Shardj/zf1-future.git", - "reference": "7ae8cb4a15a85dfd77c69661795590f4a9cff335" + "reference": "0464ee916ca73142ab733d80c83210d89cba3936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Shardj/zf1-future/zipball/7ae8cb4a15a85dfd77c69661795590f4a9cff335", - "reference": "7ae8cb4a15a85dfd77c69661795590f4a9cff335", + "url": "https://api.github.com/repos/Shardj/zf1-future/zipball/0464ee916ca73142ab733d80c83210d89cba3936", + "reference": "0464ee916ca73142ab733d80c83210d89cba3936", "shasum": "" }, "require": { @@ -1040,9 +1040,9 @@ ], "support": { "issues": "https://github.com/Shardj/zf1-future/issues", - "source": "https://github.com/Shardj/zf1-future/tree/release-1.23.2" + "source": "https://github.com/Shardj/zf1-future/tree/release-1.23.5" }, - "time": "2023-08-15T13:34:11+00:00" + "time": "2023-08-24T14:07:53+00:00" }, { "name": "symfony/console", @@ -3382,16 +3382,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.29", + "version": "1.10.32", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "ee5d8f2d3977fb09e55603eee6fb53bdd76ee9c1" + "reference": "c47e47d3ab03137c0e121e77c4d2cb58672f6d44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/ee5d8f2d3977fb09e55603eee6fb53bdd76ee9c1", - "reference": "ee5d8f2d3977fb09e55603eee6fb53bdd76ee9c1", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c47e47d3ab03137c0e121e77c4d2cb58672f6d44", + "reference": "c47e47d3ab03137c0e121e77c4d2cb58672f6d44", "shasum": "" }, "require": { @@ -3440,7 +3440,7 @@ "type": "tidelift" } ], - "time": "2023-08-14T13:24:11+00:00" + "time": "2023-08-24T21:54:50+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/docs/EVENTS.md b/docs/EVENTS.md index 42ab76a0096..88f8b20fd27 100644 --- a/docs/EVENTS.md +++ b/docs/EVENTS.md @@ -81,6 +81,7 @@ | adminhtml_widget_grid_filter_collection | 1.9.4.5 | | after_reindex_process_[getIndexerCode] | 1.9.4.5 | | ajax_cart_remove_item_success | 1.9.4.5 | +| api_server_adapter_jsonrpc_run_after | 20.1.1 | | api_user_authenticated | 1.9.4.5 | | api_user_html_before | 1.9.4.5 | | application_clean_cache | 1.9.4.5 | @@ -246,7 +247,7 @@ | newsletter_send_after | 19.5.0 / 20.1.0 | | on_view_report | 1.9.4.5 | | order_cancel_after | 1.9.4.5 | - | order_status_changed_before_save | 19.5.0 / 20.1.0 | +| order_status_changed_before_save | 19.5.0 / 20.1.0 | | page_block_html_topmenu_gethtml_after | 1.9.4.5 | | page_block_html_topmenu_gethtml_before | 1.9.4.5 | | payment_form_block_to_html_before | 1.9.4.5 | diff --git a/js/prototype/prototype.js b/js/prototype/prototype.js index 64ed4de0249..caddfc8e343 100644 --- a/js/prototype/prototype.js +++ b/js/prototype/prototype.js @@ -1111,7 +1111,7 @@ function $w(string) { return string ? string.split(/\s+/) : []; } -Array.from = $A; +Array.from = Array.from || $A; (function() {