Skip to content

Commit

Permalink
pkp/pkp-lib#5523: finish cleanup of unused sidebar context for 3.2+
Browse files Browse the repository at this point in the history
  • Loading branch information
ctgraham committed Mar 3, 2020
1 parent 41d340f commit d626471
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 2 additions & 7 deletions CustomBlockManagerPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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':
Expand Down
1 change: 0 additions & 1 deletion controllers/grid/CustomBlockGridHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit d626471

Please sign in to comment.