Skip to content

Commit

Permalink
Fix compatibility with doctrine/dbal 3 (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
qzminski authored Jun 7, 2022
1 parent b2b8d9a commit 5c42c53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
},
"require":{
"php":">=7.2",
"contao/core-bundle":"^4.9",
"contao/core-bundle":"^4.9.17 < 4.10 || ^4.11.6",
"doctrine/dbal": "^2.11 || ^3.3",
"symfony/dependency-injection": "^4.4 || ^5.2",
"symfony/framework-bundle": "^4.4 || ^5.2",
"symfony/routing": "^4.4 || ^5.2"
Expand Down
5 changes: 3 additions & 2 deletions src/Controller/JsonApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Contao\CoreBundle\Exception\RedirectResponseException;
use Contao\CoreBundle\Framework\FrameworkAwareInterface;
use Contao\CoreBundle\Framework\FrameworkAwareTrait;
use Contao\DataContainer;
use Doctrine\DBAL\Connection;
use MadeYourDay\RockSolidFrontendHelper\ElementBuilder;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
Expand Down Expand Up @@ -99,7 +100,7 @@ public function insertAction(Request $request, ElementBuilder $elementBuilder, C
->findByPk($request->get('pid'))
;
$previousId = $connection
->fetchColumn('
->fetchOne('
SELECT id
FROM tl_content
WHERE pid = :pid
Expand Down Expand Up @@ -246,7 +247,7 @@ private function callDcaMethod($act, $table, $ptable = null, $id = null)
$controller->loadDataContainer($table);
$GLOBALS['TL_DCA']['tl_content']['config']['ptable'] = $ptable;

$driver = 'DC_' . $GLOBALS['TL_DCA'][$table]['config']['dataContainer'];
$driver = DataContainer::getDriverForTable($table);
$dca = new $driver($table);
$newElementId = null;

Expand Down

0 comments on commit 5c42c53

Please sign in to comment.