Skip to content

Commit

Permalink
NTR: prepare hotfix 4.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalij Mik committed Apr 30, 2024
1 parent 91cf1e4 commit 73bbe21
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kiener/mollie-payments-plugin",
"description": "Mollie Payments",
"version": "v4.7.1",
"version": "v4.7.2",
"type": "shopware-platform-plugin",
"license": "MIT",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php declare(strict_types=1);

namespace Shopware\Core\System\Snippet\Files;


if (interface_exists(__NAMESPACE__.'/SnippetFileInterface')) {
return;
}

interface SnippetFileInterface
{
/**
* Returns the displayed name.
*
* Example:
* storefront.en-GB
*/
public function getName(): string;

/**
* Returns the path to the json language file.
*
* Example:
* /appPath/subDirectory/storefront.en-GB.json
*/
public function getPath(): string;

/**
* Returns the associated language ISO.
*
* Example:
* en-GB
* de-DE
*/
public function getIso(): string;

/**
* Return the snippet author, which will be used when editing a file snippet in a snippet set
*
* Example:
* shopware
* pluginName
*/
public function getAuthor(): string;

/**
* Returns a boolean which determines if its a base language file
*/
public function isBase(): bool;
}
4 changes: 2 additions & 2 deletions src/Migration/Migration1711618833SubscriptionCurrency.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function getCreationTimestamp(): int

public function update(Connection $connection): void
{
$utils = new MigrationUtils($connection);
// add new columns
$sql = "ALTER TABLE `mollie_subscription`
ADD COLUMN `currency_id` BINARY(16) NULL AFTER `currency`,
Expand Down Expand Up @@ -63,8 +64,7 @@ public function update(Connection $connection): void
}

//delete unsused column
$sql = "ALTER TABLE `mollie_subscription` DROP COLUMN `currency`";
$connection->executeStatement($sql);
$utils->deleteColumn('mollie_subscription', 'currency');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/MolliePayments.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

class MolliePayments extends Plugin
{
const PLUGIN_VERSION = '4.7.1';
const PLUGIN_VERSION = '4.7.2';


/**
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@


<service id="Kiener\MolliePayments\Subscriber\KernelSubscriber">
<argument type="service" id="Kiener\MolliePayments\Compatibility\VersionCompare"/>
<tag name="kernel.event_subscriber"/>
</service>

Expand Down Expand Up @@ -207,6 +208,11 @@
<tag name="kernel.event_subscriber"/>
</service>

<service id="Kiener\MolliePayments\Compatibility\VersionCompare">
<argument>%kernel.shopware_version%</argument>
</service>


<!-- Mail -->
<service id="mollie_payments.mail_service" class="Kiener\MolliePayments\Service\Mail\MailService">
<argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
Expand Down
20 changes: 20 additions & 0 deletions src/Subscriber/KernelSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Kiener\MolliePayments\Subscriber;

use Kiener\MolliePayments\Compatibility\VersionCompare;
use Shopware\Core\Framework\Routing\Annotation\RouteScope;
use Shopware\Core\PlatformRequest;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
Expand All @@ -11,6 +12,20 @@

class KernelSubscriber implements EventSubscriberInterface
{
/**
* @var VersionCompare
*/
private $versionCompare;

/**
* @param VersionCompare $versionCompare
*/
public function __construct(VersionCompare $versionCompare)
{
$this->versionCompare = $versionCompare;
}


public static function getSubscribedEvents(): array
{
return [
Expand All @@ -25,6 +40,11 @@ public static function getSubscribedEvents(): array
*/
public function onModifyRouteScope(ControllerEvent $event): void
{
//there are cases where the class RouteScope still exists even in SW 6.5
if ($this->versionCompare->gte('6.5.0.0')) {
return;
}

if (! class_exists(RouteScope::class)) {
return;
}
Expand Down

0 comments on commit 73bbe21

Please sign in to comment.