Skip to content

Commit

Permalink
Fix route loading in Contao 4.13
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Nov 26, 2024
1 parent 3019080 commit c7956dc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"php": "^8.1",
"composer-plugin-api": "^2.0",
"codefog/contao-haste": "^5.2",
"contao/core-bundle": "^4.13.50 || ^5.3.14 || ^5.4.4",
"contao/core-bundle": "^4.13.50 || ~5.3.14 || ^5.4.4",
"doctrine/dbal": "^3.4",
"doctrine/orm": "^2.19",
"knplabs/knp-menu": "^3.1",
Expand Down
5 changes: 3 additions & 2 deletions src/ContaoManager/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Contao\ManagerPlugin\Routing\RoutingPluginInterface;
use Symfony\Component\Config\Loader\LoaderResolverInterface;
use Symfony\Component\HttpKernel\KernelInterface;
use Terminal42\NotificationCenterBundle\Controller\DownloadBulkyItemController;
use Terminal42\NotificationCenterBundle\Terminal42NotificationCenterBundle;

class Plugin implements BundlePluginInterface, RoutingPluginInterface
Expand All @@ -27,8 +28,8 @@ public function getBundles(ParserInterface $parser): array
public function getRouteCollection(LoaderResolverInterface $resolver, KernelInterface $kernel)
{
return $resolver
->resolve(__DIR__.'/../Controller/DownloadBulkyItemController.php', 'attribute')
->load(__DIR__.'/../Controller/DownloadBulkyItemController.php')
->resolve(DownloadBulkyItemController::class)
->load(DownloadBulkyItemController::class)
;
}
}
6 changes: 4 additions & 2 deletions src/Controller/DownloadBulkyItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpFoundation\UriSigner;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Routing\Annotation\Route;
use Terminal42\NotificationCenterBundle\BulkyItem\BulkyItemStorage;

#[Route('/notifications/download/{voucher}', 'nc_bulky_item_download', requirements: ['voucher' => BulkyItemStorage::VOUCHER_REGEX])]
/**
* @Route("/notifications/download/{voucher}", name="nc_bulky_item_download", requirements={"voucher"=BulkyItemStorage::VOUCHER_REGEX})
*/
class DownloadBulkyItemController
{
public function __construct(
Expand Down

0 comments on commit c7956dc

Please sign in to comment.