From d626471532cac6afeae8bfe8bfc3294015f9f00b Mon Sep 17 00:00:00 2001 From: Clinton Graham Date: Tue, 3 Mar 2020 17:12:10 -0500 Subject: [PATCH] pkp/pkp-lib#5523: finish cleanup of unused sidebar context for 3.2+ --- CustomBlockManagerPlugin.inc.php | 9 ++------- controllers/grid/CustomBlockGridHandler.inc.php | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/CustomBlockManagerPlugin.inc.php b/CustomBlockManagerPlugin.inc.php index 12af83d..a321ae8 100644 --- a/CustomBlockManagerPlugin.inc.php +++ b/CustomBlockManagerPlugin.inc.php @@ -14,12 +14,6 @@ * */ -// No constant name in core 3.2 (!?!), per https://github.com/pkp/pkp-lib/commit/a76bac72ed068a1d1866398d20cdf28c4977249f#diff-70caff5ef9a513397af1833a3e2a3c7c -import('lib.pkp.classes.plugins.BlockPlugin'); -if (!defined('BLOCK_CONTEXT_SIDEBAR')) { - define('BLOCK_CONTEXT_SIDEBAR', 1); -} - import('lib.pkp.classes.plugins.GenericPlugin'); class CustomBlockManagerPlugin extends GenericPlugin { @@ -204,7 +198,8 @@ function installFilters($hookName, $args) { foreach ($settings as $setting_name => $setting_value) { switch ($setting_name) { case 'context': - $setting_value = BLOCK_CONTEXT_SIDEBAR; + $pluginSettingsDao->deleteSetting($context->getId(), $blockName, $setting_name); + break; case 'blockContent': case 'enabled': case 'seq': diff --git a/controllers/grid/CustomBlockGridHandler.inc.php b/controllers/grid/CustomBlockGridHandler.inc.php index eb43122..baa6721 100644 --- a/controllers/grid/CustomBlockGridHandler.inc.php +++ b/controllers/grid/CustomBlockGridHandler.inc.php @@ -207,7 +207,6 @@ function deleteCustomBlock($args, $request) { // Delete all the entries for this block plugin $pluginSettingsDao = DAORegistry::getDAO('PluginSettingsDAO'); $pluginSettingsDao->deleteSetting($contextId, $blockName, 'enabled'); - $pluginSettingsDao->deleteSetting($contextId, $blockName, 'context'); $pluginSettingsDao->deleteSetting($contextId, $blockName, 'seq'); $pluginSettingsDao->deleteSetting($contextId, $blockName, 'blockContent');