Skip to content

Commit bf4a22a

Browse files
authored
Merge pull request #29 from maximehuran/feature/fixes-updates
2 parents 61e44d1 + 869639c commit bf4a22a

File tree

13 files changed

+52
-12
lines changed

13 files changed

+52
-12
lines changed

.github/workflows/recipe.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
php: [ '8.2', '8.3' ]
18-
sylius: [ '~2.0.0' ]
18+
sylius: [ '~2.0.0', '~2.0.1' ]
1919

2020
steps:
2121
- name: Setup PHP

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DEFAULT_GOAL := help
22
SHELL=/bin/bash
33
APP_DIR=tests/Application
4-
SYLIUS_VERSION=2.0.0
4+
SYLIUS_VERSION=2.1.0
55
SYMFONY=cd ${APP_DIR} && symfony
66
COMPOSER=symfony composer
77
CONSOLE=${SYMFONY} console
@@ -72,6 +72,9 @@ setup_application:
7272
(cd ${APP_DIR} && ${COMPOSER} config --no-plugins allow-plugins true)
7373
(cd ${APP_DIR} && ${COMPOSER} config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]')
7474
(cd ${APP_DIR} && ${COMPOSER} require --no-install --no-scripts --no-progress sylius/sylius="~${SYLIUS_VERSION}") # Make sure to install the required version of sylius because the sylius-standard has a soft constraint
75+
# Temporary fix for Sylius 2.1
76+
(cd ${APP_DIR} && ${COMPOSER} require --no-install --no-scripts --no-progress api-platform/state)
77+
# End Temporary fix for Sylius 2.1
7578
$(MAKE) ${APP_DIR}/.php-version
7679
$(MAKE) ${APP_DIR}/php.ini
7780
(cd ${APP_DIR} && ${COMPOSER} install --no-interaction)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This plugin adds a media manager to your images, videos and other files type fie
1717

1818
| Sylius Version | PHP Version |
1919
|----------------|-------------|
20-
| 2.0 | 8.2 - 8.3 |
20+
| 2.0, 2,1 | 8.2 - 8.3 |
2121

2222
ℹ️ For Sylius 1.x, see our [1.x branch](https://github.com/monsieurbiz/SyliusMediaManagerPlugin/tree/1.x) and all 1.x releases.
2323

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"require": {
88
"php": "^8.2",
9-
"sylius/sylius": "~2.0.0",
9+
"sylius/sylius": "~2.0",
1010
"phpdocumentor/reflection-docblock": "^5.6"
1111
},
1212
"require-dev": {

dist/migrations/Version20250410102216.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
declare(strict_types=1);
1313

14-
namespace App;
14+
namespace DoctrineMigrations;
1515

1616
use Doctrine\DBAL\Schema\Schema;
1717
use Doctrine\Migrations\AbstractMigration;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
/*
4+
* This file is part of Monsieur Biz' Media Manager plugin for Sylius.
5+
*
6+
* (c) Monsieur Biz <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE.txt
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace App\Context\Channel\RequestBased;
15+
16+
use Sylius\Component\Channel\Context\RequestBased\RequestResolverInterface;
17+
use Sylius\Component\Channel\Model\ChannelInterface;
18+
use Sylius\Component\Channel\Repository\ChannelRepositoryInterface;
19+
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
20+
use Symfony\Component\HttpFoundation\Request;
21+
22+
#[AutoconfigureTag('sylius.context.channel.request_based.resolver')]
23+
final class HostnameAndPortBasedRequestResolver implements RequestResolverInterface
24+
{
25+
public function __construct(private ChannelRepositoryInterface $channelRepository)
26+
{
27+
}
28+
29+
public function findChannel(Request $request): ?ChannelInterface
30+
{
31+
return $this->channelRepository->findOneEnabledByHostname($request->getHost() . ':' . $request->getPort());
32+
}
33+
}

dist/src/Entity/Product/Product.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@
1616
use Doctrine\ORM\Mapping as ORM;
1717
use Sylius\Component\Core\Model\Product as BaseProduct;
1818
use Sylius\Component\Product\Model\ProductTranslationInterface;
19+
use Sylius\MolliePlugin\Entity\ProductInterface;
20+
use Sylius\MolliePlugin\Entity\ProductTrait;
1921

2022
#[ORM\Entity]
2123
#[ORM\Table(name: 'sylius_product')]
22-
class Product extends BaseProduct
24+
class Product extends BaseProduct implements ProductInterface
2325
{
26+
use ProductTrait;
27+
2428
#[ORM\Column(name: 'image_path', type: 'string', nullable: true)]
2529
private ?string $imagePath;
2630

src/Components/ConfirmationModal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use Symfony\UX\LiveComponent\ComponentToolsTrait;
2222
use Symfony\UX\LiveComponent\DefaultActionTrait;
2323

24-
#[AsLiveComponent]
24+
#[AsLiveComponent(route: 'sylius_admin_live_component')]
2525
class ConfirmationModal
2626
{
2727
use ComponentToolsTrait;

src/Components/FormField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use Symfony\UX\LiveComponent\ComponentToolsTrait;
2222
use Symfony\UX\LiveComponent\DefaultActionTrait;
2323

24-
#[AsLiveComponent]
24+
#[AsLiveComponent(route: 'sylius_admin_live_component')]
2525
class FormField
2626
{
2727
use ComponentToolsTrait;

src/Components/SelectionModal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
use Symfony\UX\LiveComponent\ComponentToolsTrait;
2727
use Symfony\UX\LiveComponent\DefaultActionTrait;
2828

29-
#[AsLiveComponent]
29+
#[AsLiveComponent(route: 'sylius_admin_live_component')]
3030
class SelectionModal
3131
{
3232
use ComponentToolsTrait;

0 commit comments

Comments
 (0)