From 4f4b9f26c1364e7b8f5b1e7332398eae280d2ab4 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Sun, 22 Dec 2019 19:36:28 +0100 Subject: [PATCH 1/3] Fix dbstructure update hook for advancedcontentfilter --- advancedcontentfilter/advancedcontentfilter.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index 1b54df49d..810976488 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -56,7 +56,7 @@ require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'a function advancedcontentfilter_install(App $a) { - Hook::register('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); + Hook::add('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); Hook::register('prepare_body_content_filter', __FILE__, 'advancedcontentfilter_prepare_body_content_filter'); Hook::register('addon_settings' , __FILE__, 'advancedcontentfilter_addon_settings'); @@ -67,7 +67,6 @@ function advancedcontentfilter_install(App $a) function advancedcontentfilter_uninstall() { - Hook::unregister('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); Hook::unregister('prepare_body_content_filter', __FILE__, 'advancedcontentfilter_prepare_body_content_filter'); Hook::unregister('addon_settings' , __FILE__, 'advancedcontentfilter_addon_settings'); } From 838c28f1713633c1ab499aabe7830d6c6259e58f Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Sun, 22 Dec 2019 20:36:19 +0100 Subject: [PATCH 2/3] Add more indention :-) --- advancedcontentfilter/advancedcontentfilter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index 810976488..a37f16fd6 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -56,7 +56,7 @@ require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'a function advancedcontentfilter_install(App $a) { - Hook::add('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); + Hook::add('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); Hook::register('prepare_body_content_filter', __FILE__, 'advancedcontentfilter_prepare_body_content_filter'); Hook::register('addon_settings' , __FILE__, 'advancedcontentfilter_addon_settings'); From 382ca2b3bc7d286f0276c2ad778e6939d4e739cb Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Mon, 23 Dec 2019 01:36:32 +0100 Subject: [PATCH 3/3] Restored Hook::register and added Hook::add --- advancedcontentfilter/advancedcontentfilter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index a37f16fd6..af8bf9dee 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -56,10 +56,11 @@ require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'a function advancedcontentfilter_install(App $a) { - Hook::add('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); + Hook::register('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); Hook::register('prepare_body_content_filter', __FILE__, 'advancedcontentfilter_prepare_body_content_filter'); Hook::register('addon_settings' , __FILE__, 'advancedcontentfilter_addon_settings'); + Hook::add('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); DBStructure::update($a->getBasePath(), false, true); Logger::log("installed advancedcontentfilter"); @@ -67,6 +68,7 @@ function advancedcontentfilter_install(App $a) function advancedcontentfilter_uninstall() { + Hook::unregister('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); Hook::unregister('prepare_body_content_filter', __FILE__, 'advancedcontentfilter_prepare_body_content_filter'); Hook::unregister('addon_settings' , __FILE__, 'advancedcontentfilter_addon_settings'); }