Skip to content

Commit 04f9f64

Browse files
committed
Get rid of old hook definitions
1 parent a918de1 commit 04f9f64

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

contao/config/config.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,3 @@
2222

2323
// Models
2424
$GLOBALS['TL_MODELS']['tl_cfg_tag'] = TagModel::class;
25-
26-
// Hooks
27-
$GLOBALS['TL_HOOKS']['replaceInsertTags'][] = ['codefog_tags.listener.insert_tags', 'onReplaceInsertTags'];
28-
29-
if (is_array($GLOBALS['TL_HOOKS']['loadDataContainer'] ?? null)) {
30-
array_unshift($GLOBALS['TL_HOOKS']['loadDataContainer'], ['codefog_tags.listener.tag_manager', 'onLoadDataContainer']);
31-
} else {
32-
$GLOBALS['TL_HOOKS']['loadDataContainer'][] = ['codefog_tags.listener.tag_manager', 'onLoadDataContainer'];
33-
}

src/EventListener/TagManagerListener.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
use Codefog\TagsBundle\Manager\DcaAwareInterface;
1616
use Codefog\TagsBundle\ManagerRegistry;
17+
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
1718
use Contao\DataContainer;
1819

20+
#[AsHook('loadDataContainer', priority: 10)]
1921
readonly class TagManagerListener
2022
{
2123
public function __construct(private ManagerRegistry $registry)

0 commit comments

Comments
 (0)