Skip to content

Commit

Permalink
Merge pull request #264 from Nosto/release/2.5.2
Browse files Browse the repository at this point in the history
Release/2.5.2
  • Loading branch information
supercid committed Dec 27, 2023
2 parents 70a56fd + 7f8014a commit 0fe23ea
Show file tree
Hide file tree
Showing 12 changed files with 3,690 additions and 2,915 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer:v1, prestissimo
php-version: '7.4'
tools: composer:v2
extensions: ast
coverage: none

Expand Down Expand Up @@ -64,8 +64,8 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer:v1, prestissimo
php-version: '7.4'
tools: composer:v2
extensions: ast
coverage: none

Expand Down Expand Up @@ -111,8 +111,8 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer:v1, prestissimo
php-version: '7.4'
tools: composer:v2
extensions: ast
coverage: none

Expand Down Expand Up @@ -162,8 +162,8 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer:v1, prestissimo
php-version: '7.4'
tools: composer:v2
extensions: ast
coverage: none

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer:v1, prestissimo, pecl
php-version: '7.4'
tools: composer:v2, pecl
coverage: none

#https://github.com/actions/cache/blob/master/examples.md#php---composer
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/phan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer:v1, prestissimo, pecl
php-version: '7.4'
tools: composer:v2, pecl
coverage: none

#https://github.com/actions/cache/blob/master/examples.md#php---composer
Expand Down
5 changes: 4 additions & 1 deletion Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
class Shopware_Plugins_Frontend_NostoTagging_Bootstrap extends Shopware_Components_Plugin_Bootstrap

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has 1553 lines of code. Current threshold is 1000. Avoid really long classes.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has 48 non-getter- and setter-methods. Consider refactoring Shopware_Plugins_Frontend_NostoTagging_Bootstrap to keep number of methods under 25.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has 26 public methods. Consider refactoring Shopware_Plugins_Frontend_NostoTagging_Bootstrap to keep number of public methods under 10.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has an overall complexity of 152 which is very high. The configured complexity threshold is 50.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

Avoid excessively long class names like Shopware_Plugins_Frontend_NostoTagging_Bootstrap. Keep class name length under 40.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap is not named in CamelCase.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has a coupling between objects value of 48. Consider to reduce the number of dependencies under 13.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has 1553 lines of code. Current threshold is 1000. Avoid really long classes.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has 48 non-getter- and setter-methods. Consider refactoring Shopware_Plugins_Frontend_NostoTagging_Bootstrap to keep number of methods under 25.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has 26 public methods. Consider refactoring Shopware_Plugins_Frontend_NostoTagging_Bootstrap to keep number of public methods under 10.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has an overall complexity of 152 which is very high. The configured complexity threshold is 50.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

Avoid excessively long class names like Shopware_Plugins_Frontend_NostoTagging_Bootstrap. Keep class name length under 40.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap is not named in CamelCase.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has a coupling between objects value of 48. Consider to reduce the number of dependencies under 13.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has 1553 lines of code. Current threshold is 1000. Avoid really long classes.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has 48 non-getter- and setter-methods. Consider refactoring Shopware_Plugins_Frontend_NostoTagging_Bootstrap to keep number of methods under 25.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has 26 public methods. Consider refactoring Shopware_Plugins_Frontend_NostoTagging_Bootstrap to keep number of public methods under 10.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has an overall complexity of 152 which is very high. The configured complexity threshold is 50.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

Avoid excessively long class names like Shopware_Plugins_Frontend_NostoTagging_Bootstrap. Keep class name length under 40.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap is not named in CamelCase.

Check warning on line 85 in Bootstrap.php

View workflow job for this annotation

GitHub Actions / Mess Detect

The class Shopware_Plugins_Frontend_NostoTagging_Bootstrap has a coupling between objects value of 48. Consider to reduce the number of dependencies under 13.
{
const PLATFORM_NAME = 'shopware';
const PLUGIN_VERSION = '2.5.1';
const PLUGIN_VERSION = '2.5.2';
const MENU_PARENT_ID = 23; // Configuration
const NEW_ATTRIBUTE_MANAGER_VERSION = '5.2.0';
const SUPPORT_SHOW_REVIEW_SUB_SHOP_ONLY_VERSION = '5.3.0';
Expand Down Expand Up @@ -487,6 +487,7 @@ public function getShopwareVersion()
* Creates Nosto emotions for Shopping World templates
*
* @see Shopware_Plugins_Frontend_NostoTagging_Bootstrap::install
* @suppress PhanTypeMismatchArgument
*/
protected function createMyEmotions()
{
Expand Down Expand Up @@ -1070,6 +1071,7 @@ public function generateCustomerTagging()
*
* @see Shopware_Controllers_Frontend_NostoTagging::noCacheTaggingAction
* @return NostoCartModel|null
* @suppress PhanDeprecatedFunction
*/
public function generateCartTagging()
{
Expand Down Expand Up @@ -1334,6 +1336,7 @@ public function onPostDispatchFrontendCheckout(Enlight_Controller_ActionEventArg
* @param Enlight_View_Default $view the view.
*
* @throws Enlight_Event_Exception
* @suppress PhanDeprecatedFunction
* @see Shopware_Plugins_Frontend_NostoTagging_Bootstrap::onPostDispatchFrontendCheckout
*/
protected function addOrderTagging(Enlight_View_Default $view)
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## 2.5.2
- Fix a bug that would cause the order tagging to get article items that are not products
- Add exception handling when checking for a payment provider in orders (@Forestsoft-de)

## 2.5.1
- Change Nosto script from `const` to `var` to be globally accessible by the browser.
- Remove all references to non-existent `Shopware()->SessionID()` method.
Expand Down
2 changes: 2 additions & 0 deletions Components/Helper/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ public static function calcArticlePriceInclTax(
* @param Price $price
* @param Tax $tax
* @return float|int
* @suppress PhanTypeMismatchReturnNullable
* @suppress PhanTypeInvalidLeftOperandOfNumericOp
*/
public static function applyTaxes(
$priceWithoutTax,
Expand Down
10 changes: 8 additions & 2 deletions Components/Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@ public function loadData(Order $order)
try {
$paymentProvider = $payment->getName();
$paymentPlugin = $payment->getPlugin();
if ($paymentPlugin !== null && $paymentPlugin->getVersion()) {
$paymentProvider .= sprintf(' [%s]', $paymentPlugin->getVersion());
if ($payment instanceof \Shopware\Models\Payment\Payment) {
$paymentProvider = $payment->getName();
$paymentPlugin = $payment->getPlugin();
if ($paymentPlugin !== null && $paymentPlugin->getVersion()) {
$paymentProvider .= sprintf(' [%s]', $paymentPlugin->getVersion());
}
} else {
throw new \InvalidArgumentException(sprintf("Could not determine payment method of order %s", $order->getNumber()));
}
} catch (Exception $e) {
$paymentProvider = 'unknown';
Expand Down
3 changes: 2 additions & 1 deletion Components/Model/Order/LineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public function loadData(OrderDetail $detail)
->Models()
->getRepository('\Shopware\Models\Article\Detail')
->findOneBy(array('articleId' => $detail->getArticleId()));
if ($articleDetail !== null) {
// Check if the article is a product
if ($articleDetail !== null && $articleDetail->getKind() === 1) {
$this->setProductId($articleDetail->getNumber());
}
} catch (Exception $e) {
Expand Down
1 change: 1 addition & 0 deletions Components/Model/Repository/ProductStreams.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function __construct()
*
* @param Article $article
* @return array
* @suppress PhanDeprecatedFunction
*/
public function getProductStreamsSelectionName(Article $article)
{
Expand Down
1 change: 1 addition & 0 deletions Controllers/frontend/NostoTagging.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public function oauthAction()
$shop->getId()
));
}
// @phan-suppress-next-line PhanTypeMismatchArgument
$token = $this->getAuthenticatedToken($shop, $code);
$result = $this->fireRequest($token);
$nostoAccount = new NostoAccount($token->getMerchantName());
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": [
"BSD-3-Clause"
],
"version": "2.5.1",
"version": "2.5.2",
"require": {
"php": ">=5.4.0",
"nosto/php-sdk": "3.15.*",
Expand All @@ -16,7 +16,7 @@
"phpmd/phpmd": "^2.6",
"sebastian/phpcpd": "4.1.0",
"phing/phing": "2.*",
"shopware/shopware": "~5.6",
"shopware/shopware": "~5.7",
"wimg/php-compatibility": "^9.0",
"staabm/annotate-pull-request-from-checkstyle": "^1.1",
"mridang/pmd-annotations": "^0.0.2",
Expand Down

0 comments on commit 0fe23ea

Please sign in to comment.