Fix Doctrine DBAL 4 compatibility in array parameter binding
Connection::PARAM_INT_ARRAY was removed in Doctrine DBAL 4.0 and replaced by ArrayParameterType::INTEGER. Under DBAL 4.4.3 every call site raised "Undefined constant", which resulted in HTTP 500 on all Angebote and Orte pages of every parish and affected the iCal export. Replaces all five occurrences in OfferListener, PlaceListener and ModifyIcalDataListener and adds the required import. The Connection import is kept, as it is still used for the constructor type hints. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ use Contao\CalendarEventsModel;
|
||||
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
|
||||
use Kigkonsult\Icalcreator\Vevent;
|
||||
use Contao\System;
|
||||
use Doctrine\DBAL\ArrayParameterType;
|
||||
use Doctrine\DBAL\Connection;
|
||||
|
||||
#[AsHook('editVEvent')]
|
||||
@@ -49,7 +50,7 @@ class ModifyIcalDataListener
|
||||
->select('contactsTerm', 'contactsFirstname', 'contactsLastname', 'contactsEmail')
|
||||
->from('ctlg_contacts')
|
||||
->where('id IN (:ids)')
|
||||
->setParameter('ids', $contactIds, Connection::PARAM_INT_ARRAY)
|
||||
->setParameter('ids', $contactIds, ArrayParameterType::INTEGER)
|
||||
->executeQuery();
|
||||
|
||||
$contacts = $query->fetchAllAssociative();
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace Mummert\KsNossenerlandBundle\EventListener;
|
||||
use Contao\CoreBundle\ServiceAnnotation\Hook;
|
||||
use Contao\Template;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Doctrine\DBAL\ArrayParameterType;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Contao\StringUtil;
|
||||
|
||||
@@ -38,7 +39,7 @@ class OfferListener
|
||||
$gemeindenRaw = $this->connection->fetchAllAssociative(
|
||||
'SELECT * FROM ctlg_gemeinden WHERE id IN (?)',
|
||||
[$gemeindeIds],
|
||||
[Connection::PARAM_INT_ARRAY]
|
||||
[ArrayParameterType::INTEGER]
|
||||
);
|
||||
|
||||
foreach ($gemeindenRaw as $gemeinde) {
|
||||
@@ -89,7 +90,7 @@ class OfferListener
|
||||
$gemeindenRaw = $this->connection->fetchAllAssociative(
|
||||
'SELECT * FROM ctlg_gemeinden WHERE id IN (?)',
|
||||
[$gemeindeIds],
|
||||
[Connection::PARAM_INT_ARRAY]
|
||||
[ArrayParameterType::INTEGER]
|
||||
);
|
||||
|
||||
foreach ($gemeindenRaw as $gemeinde) {
|
||||
@@ -194,7 +195,7 @@ class OfferListener
|
||||
LEFT JOIN ctlg_districts d ON g.gemeindeBereich = d.id
|
||||
WHERE g.id IN (?)',
|
||||
[$gemeindeIds],
|
||||
[Connection::PARAM_INT_ARRAY]
|
||||
[ArrayParameterType::INTEGER]
|
||||
);
|
||||
|
||||
foreach ($rows as $row) {
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace Mummert\KsNossenerlandBundle\EventListener;
|
||||
use Contao\CoreBundle\ServiceAnnotation\Hook;
|
||||
use Contao\Template;
|
||||
use Contao\StringUtil;
|
||||
use Doctrine\DBAL\ArrayParameterType;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
@@ -51,7 +52,7 @@ class PlaceListener
|
||||
LEFT JOIN ctlg_districts d ON g.gemeindeBereich = d.id
|
||||
WHERE g.id IN (?)',
|
||||
[$gemeindeIds],
|
||||
[Connection::PARAM_INT_ARRAY]
|
||||
[ArrayParameterType::INTEGER]
|
||||
);
|
||||
|
||||
foreach ($rows as $row) {
|
||||
|
||||
Reference in New Issue
Block a user