Use the PaletteManipulator from the core bundle namespace
Contao\PaletteManipulator does not exist; the settings listeners would have failed with a fatal error in the list view and as soon as a notification of the type "W&K booking" exists. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
a96eed690a
commit
1d2007a701
2 files changed
+4
-8
No files matched your search
@@ -4,9 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace Mummert\ContaoWkSyncBundle\EventListener\DataContainer;
|
||||
|
||||
use Contao\CoreBundle\DataContainer\PaletteManipulator;
|
||||
use Contao\CoreBundle\DependencyInjection\Attribute\AsCallback;
|
||||
use Contao\CoreBundle\Framework\ContaoFramework;
|
||||
use Contao\PaletteManipulator;
|
||||
use Mummert\ContaoWkSyncBundle\Booking\BookingNotifierInterface;
|
||||
use Symfony\Component\Routing\RouterInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
@@ -22,14 +21,13 @@ class NotificationNoticeListener
|
||||
private readonly BookingNotifierInterface $notifier,
|
||||
private readonly RouterInterface $router,
|
||||
private readonly TranslatorInterface $translator,
|
||||
private readonly ContaoFramework $framework,
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(): void
|
||||
{
|
||||
if ([] !== $this->notifier->availableNotifications()) {
|
||||
$this->framework->getAdapter(PaletteManipulator::class)->create()
|
||||
PaletteManipulator::create()
|
||||
->removeField('notificationNotice')
|
||||
->applyToPalette('default', 'tl_wk_config');
|
||||
|
||||
|
||||
@@ -4,9 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace Mummert\ContaoWkSyncBundle\EventListener\DataContainer;
|
||||
|
||||
use Contao\CoreBundle\DataContainer\PaletteManipulator;
|
||||
use Contao\CoreBundle\DependencyInjection\Attribute\AsCallback;
|
||||
use Contao\CoreBundle\Framework\ContaoFramework;
|
||||
use Contao\PaletteManipulator;
|
||||
use Contao\StringUtil;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Mummert\ContaoWkSyncBundle\Booking\BookingFields;
|
||||
@@ -32,7 +31,6 @@ class SetupCheckListener
|
||||
private readonly Connection $connection,
|
||||
private readonly RequestStack $requestStack,
|
||||
private readonly TranslatorInterface $translator,
|
||||
private readonly ContaoFramework $framework,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -41,7 +39,7 @@ class SetupCheckListener
|
||||
$request = $this->requestStack->getCurrentRequest();
|
||||
|
||||
if (null === $request || 'edit' !== $request->query->get('act') || 'wk_config' !== $request->query->get('do')) {
|
||||
$this->framework->getAdapter(PaletteManipulator::class)->create()->removeField('setupCheck')->applyToPalette('default', 'tl_wk_config');
|
||||
PaletteManipulator::create()->removeField('setupCheck')->applyToPalette('default', 'tl_wk_config');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user