We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

Bug 6582 - "custom block" delete option under Block Plugins is misleading
"custom block" delete option under Block Plugins is misleading
Product: OJS
Classification: Unclassified
Component: Plug-ins
All All
: P3 normal
Assigned To: PKP Support
Depends on:
  Show dependency treegraph
Reported: 2011-04-12 13:47 PDT by James MacGregor
Modified: 2014-09-11 13:44 PDT (History)
3 users (show)

See Also:
Version Reported In:
Also Affects:


Note You need to log in before you can comment on or make changes to this bug.
Description James MacGregor 2011-04-12 13:47:53 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.
Comment 1 Clinton Graham 2014-08-13 12:45:42 PDT
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.
Comment 2 Alec Smecher 2014-08-13 12:48:03 PDT
Pull request opened (not merged):
Override getCurrentVersion() on Custom Block Plugin
Comment 3 Alec Smecher 2014-08-13 13:26:08 PDT
Clinton, have you seen the Plugin::getHideManagement function? I think that'll do what you're looking for.
Comment 4 Clinton Graham 2014-08-13 13:30:26 PDT
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.
Comment 5 Alec Smecher 2014-09-11 13:43:01 PDT
Merged -- that seems like a clean solution.
Comment 6 Alec Smecher 2014-09-11 13:44:02 PDT
Pull request closed (merged):
Override getCurrentVersion() on Custom Block Plugin
Comment 7 Clinton Graham 2014-09-11 13:44:02 PDT
Override getCurrentVersion() on Custom Block Plugin to prevent the upgrade and delete management verbs for a subsidiary plugin