Skip to content

Commit a52ba0c

Browse files
authored
Merge pull request #2061 from Crown-Commercial-Service/fix-gated-form-issue
Fix gated form issue
2 parents 29d29c0 + e10d043 commit a52ba0c

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

src/Controller/DigitalBrochureController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\HttpFoundation\Request;
1515
use Strata\Frontend\Exception\NotFoundException;
1616
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
17+
use Psr\Log\LoggerInterface;
1718

1819
class DigitalBrochureController extends AbstractController
1920
{
@@ -25,7 +26,7 @@ class DigitalBrochureController extends AbstractController
2526
protected $api;
2627
protected $formController;
2728

28-
public function __construct(CacheItemPoolInterface $cache)
29+
public function __construct(CacheItemPoolInterface $cache, FormController $formController)
2930
{
3031

3132
$this->api = new WordPress(
@@ -36,7 +37,7 @@ public function __construct(CacheItemPoolInterface $cache)
3637
$psr16Cache = new Psr16Cache($cache);
3738
$this->api->setCache($psr16Cache);
3839
$this->api->setCacheLifetime(900);
39-
$this->formController = new FormController($cache);
40+
$this->formController = $formController;
4041
}
4142

4243
public function request($id, $slug, Request $request)

src/Controller/DownloadableResourceController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\HttpFoundation\Request;
1515
use Strata\Frontend\Exception\NotFoundException;
1616
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
17+
use Psr\Log\LoggerInterface;
1718

1819
class DownloadableResourceController extends AbstractController
1920
{
@@ -25,9 +26,8 @@ class DownloadableResourceController extends AbstractController
2526
protected $api;
2627
protected $formController;
2728

28-
public function __construct(CacheItemPoolInterface $cache)
29+
public function __construct(CacheItemPoolInterface $cache, FormController $formController)
2930
{
30-
3131
$this->api = new WordPress(
3232
getenv('APP_API_BASE_URL'),
3333
new ContentModel(__DIR__ . '/../../config/content/content-model.yaml')
@@ -36,7 +36,7 @@ public function __construct(CacheItemPoolInterface $cache)
3636
$psr16Cache = new Psr16Cache($cache);
3737
$this->api->setCache($psr16Cache);
3838
$this->api->setCacheLifetime(900);
39-
$this->formController = new FormController($cache);
39+
$this->formController = $formController;
4040
}
4141

4242
public function request($id, $slug, Request $request)

src/Controller/WebinarController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\HttpFoundation\Request;
1515
use Strata\Frontend\Exception\NotFoundException;
1616
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
17+
use Psr\Log\LoggerInterface;
1718

1819
class WebinarController extends AbstractController
1920
{
@@ -25,7 +26,7 @@ class WebinarController extends AbstractController
2526
protected $api;
2627
protected $formController;
2728

28-
public function __construct(CacheItemPoolInterface $cache)
29+
public function __construct(CacheItemPoolInterface $cache, FormController $formController)
2930
{
3031
$this->api = new Wordpress(
3132
getenv('APP_API_BASE_URL'),
@@ -35,7 +36,7 @@ public function __construct(CacheItemPoolInterface $cache)
3536
$psr16Cache = new Psr16Cache($cache);
3637
$this->api->setCache($psr16Cache);
3738
$this->api->setCacheLifetime(900);
38-
$this->formController = new FormController($cache);
39+
$this->formController = $formController;
3940
}
4041

4142
public function request($id, $slug, Request $request)

src/Controller/WhitepaperController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\HttpFoundation\Request;
1515
use Strata\Frontend\Exception\NotFoundException;
1616
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
17+
use Psr\Log\LoggerInterface;
1718

1819
class WhitepaperController extends AbstractController
1920
{
@@ -25,7 +26,7 @@ class WhitepaperController extends AbstractController
2526
protected $api;
2627
protected $formController;
2728

28-
public function __construct(CacheItemPoolInterface $cache)
29+
public function __construct(CacheItemPoolInterface $cache, FormController $formController)
2930
{
3031
$this->api = new WordPress(
3132
getenv('APP_API_BASE_URL'),
@@ -35,7 +36,7 @@ public function __construct(CacheItemPoolInterface $cache)
3536
$psr16Cache = new Psr16Cache($cache);
3637
$this->api->setCache($psr16Cache);
3738
$this->api->setCacheLifetime(900);
38-
$this->formController = new FormController($cache);
39+
$this->formController = $formController;
3940
}
4041

4142
public function request($id, $slug, Request $request)

0 commit comments

Comments
 (0)