PKP Bugzilla – Bug 6582
"custom block" delete option under Block Plugins is misleading
Last modified: 2014-08-13 13:30:26 PDT
This one is a little mind-bending. If I create a custom block plugin from Generic -> Custom Block Manager Plugin, the plugin listing under Blocks Plugins -> somecustomblock includes a "Delete" option. Clicking Delete actually deletes the Custom Block Manager plugin under Generic Plugins -- not the custom block made BY the plugin.
If users want to delete a custom block, they should do so from Generic Plugins -> Custom Block Manager -> Settings.
Ideally, there should be no "Delete" option for custom blocks; of if so, it should only delete the custom block, not the Custom Block Manager plugin. Regardless, this behaviour isn't made explicitly clear to users, but should be.
I'd like to do something similar with the plumAnalytics plugin, which has a subsidiary block plugin to the parent generic plugin. The subsidiary block plugin should not display the upgrade and delete management verbs. These are in the template, so overriding the getManagementVerbs() is ineffective. The template does check if the plugin's getCurrentVersion() method returns a non-false value, so this may be the way to go. A subsidiary plugin probably shouldn't have a version of its own (this should be left to the parent), so overriding getCurrentVersion() to false accomplishes the desired effect.
Submitted for consideration.
Pull request opened (not merged):
Override getCurrentVersion() on Custom Block Plugin
Clinton, have you seen the Plugin::getHideManagement function? I think that'll do what you're looking for.
I'm currently using getHideManagement() in Plum, but it wouldn't be appropriate for the Custom Block Plugins ("Edit" still needs to be available at the block level). I had Plum configured for a bit to have a "Edit" feature on the block, and may need to reactivate it again in the future.