Browse code

Add alias to assets

Benjamin Roth authored on01/10/2024 14:52:16
Showing3 changed files
... ...
@@ -4,6 +4,7 @@ declare(strict_types=1);
4 4
 
5 5
 namespace vonRotenberg\RealEstateListingBundle\Controller\FrontendModule;
6 6
 
7
+use Contao\Config;
7 8
 use vonRotenberg\RealEstateListingBundle\Model\ManagedPropertyModel;
8 9
 use Contao\ArrayUtil;
9 10
 use Contao\Controller;
... ...
@@ -50,7 +51,7 @@ class ManagedPropertyReaderController extends AbstractFrontendModuleController
50 51
         $jumpTo = PageModel::findByPk($model->jumpTo);
51 52
 
52 53
         // Set the item from the auto_item parameter
53
-        if (!isset($_GET['items']) && \Config::get('useAutoItem') && isset($_GET['auto_item']))
54
+        if (!isset($_GET['items']) && Config::get('useAutoItem') && Input::get('auto_item'))
54 55
         {
55 56
             Input::setGet('items', Input::get('auto_item'));
56 57
         }
... ...
@@ -9,6 +9,7 @@
9 9
 
10 10
 namespace vonRotenberg\RealEstateListingBundle\Controller\FrontendModule;
11 11
 
12
+use Contao\Config;
12 13
 use Contao\CoreBundle\DependencyInjection\Attribute\AsFrontendModule;
13 14
 use Contao\CoreBundle\Exception\ResponseException;
14 15
 use Contao\CoreBundle\Twig\FragmentTemplate;
... ...
@@ -50,7 +51,7 @@ class RealEstateAssetsReaderController extends RealEstateAssetsModuleController
50 51
 
51 52
         // Set the item from the auto_item parameter
52 53
         dump($_GET);
53
-        if (Input::get('items') === null && \Config::get('useAutoItem') && Input::get('auto_item'))
54
+        if (Input::get('items') === null && Config::get('useAutoItem') && Input::get('auto_item'))
54 55
         {
55 56
             Input::setGet('items', Input::get('auto_item'));
56 57
         }
... ...
@@ -33,7 +33,7 @@ class ReplaceInsertTagsListener
33 33
         $insertTag = array_shift($elements);
34 34
 
35 35
         if ('re_asset' === $insertTag) {
36
-            if (!isset($_GET['items']) && Config::get('useAutoItem') && isset($_GET['auto_item']))
36
+            if (!isset($_GET['items']) && Config::get('useAutoItem') && Input::get('auto_item'))
37 37
             {
38 38
                 $varId = Input::get('auto_item');
39 39
             } else {