Skip to content

Commit

Permalink
Fix missing globals array
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Dec 5, 2020
1 parent 1d6f417 commit 20dfde3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core-bundle/src/Migration/Version401/Version410Update.php
Expand Up @@ -12,6 +12,7 @@

namespace Contao\CoreBundle\Migration\Version401;

use Contao\CoreBundle\Framework\ContaoFramework;
use Contao\CoreBundle\Migration\AbstractMigration;
use Contao\CoreBundle\Migration\MigrationResult;
use Doctrine\DBAL\Connection;
Expand All @@ -26,9 +27,15 @@ class Version410Update extends AbstractMigration
*/
private $connection;

public function __construct(Connection $connection)
/**
* @var ContaoFramework
*/
private $framework;

public function __construct(Connection $connection, ContaoFramework $framework)
{
$this->connection = $connection;
$this->framework = $framework;
}

public function getName(): string
Expand All @@ -51,6 +58,8 @@ public function shouldRun(): bool

public function run(): MigrationResult
{
$this->framework->initialize();

$crop = $GLOBALS['TL_CROP'];

if (empty($crop)) {
Expand Down
1 change: 1 addition & 0 deletions core-bundle/src/Resources/config/migrations.yml
Expand Up @@ -19,6 +19,7 @@ services:
Contao\CoreBundle\Migration\Version401\Version410Update:
arguments:
- '@database_connection'
- '@contao.framework'

Contao\CoreBundle\Migration\Version403\Version430Update:
arguments:
Expand Down

0 comments on commit 20dfde3

Please sign in to comment.