Skip to content

Commit

Permalink
Merge branch 'removed-update-old-version' into 'master'
Browse files Browse the repository at this point in the history
Removed the update method of old version

See merge request shape-and-shift/plugins/shopware-esd!23
  • Loading branch information
ChristopherDosin committed Dec 7, 2020
2 parents 98b582c + ca9bdfe commit 7a0088c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.2.13
* Die Methode `updateTo120` des Update Lifecycle wurde entfernt, da sie durch die Migration ersetzt worden ist.

# 1.2.12
* Es wurde ein Fehler behoben, wonach eine falsche Class geladen worden ist, was zu deinen Fehler in den Business Events führe

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.2.13
* Removed `updateTo120` method of the update version, because it has been replaced with the migration

# 1.2.12
* Fixed the error of using wrong class names and change the namespace and directory of events

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description":"ESD / Download plugin",
"type":"shopware-platform-plugin",
"keywords": ["esd", "download"],
"version":"1.2.12",
"version":"1.2.13",
"license":"proprietary",
"authors":[
{
Expand Down
17 changes: 0 additions & 17 deletions src/Utils/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Sas\Esd\Content\Product\Extension\Esd\Aggregate\EsdMedia\EsdMediaDefinition;
use Sas\Esd\Content\Product\Extension\Esd\EsdDefinition;
use Sas\Esd\Migration\Migration1597597704CreateEsdMediaTable;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
use Shopware\Core\Framework\Plugin\Context\UpdateContext;
use Shopware\Core\Framework\Uuid\Uuid;

Expand All @@ -18,10 +17,6 @@ public function update(ContainerInterface $container, UpdateContext $updateConte
if (\version_compare($updateContext->getCurrentPluginVersion(), '1.1.0', '<')) {
$this->updateTo110($container);
}

if (\version_compare($updateContext->getCurrentPluginVersion(), '1.2.0', '<')) {
$this->updateTo120($container, $updateContext);
}
}

private function updateTo110(ContainerInterface $container): void
Expand Down Expand Up @@ -54,16 +49,4 @@ private function updateTo110(ContainerInterface $container): void
$connection->update(EsdDefinition::ENTITY_NAME, ['media_id' => null], ['id' => Uuid::fromHexToBytes($esd['id'])]);
}
}

private function updateTo120(ContainerInterface $container, UpdateContext $updateContext): void
{
/** @var EntityRepositoryInterface $mailTemplateTypeRepository */
$mailTemplateTypeRepository = $container->get('mail_template_type.repository');

/** @var EntityRepositoryInterface $mailTemplateRepository */
$mailTemplateRepository = $container->get('mail_template.repository');

EsdMailTemplate::addDownloadMailTemplate($mailTemplateTypeRepository, $mailTemplateRepository, $updateContext->getContext());
EsdMailTemplate::addSerialMailTemplate($mailTemplateTypeRepository, $mailTemplateRepository, $updateContext->getContext());
}
}

0 comments on commit 7a0088c

Please sign in to comment.