Plugin with require_parent = True leads to weird behavior if used in CMS_PLACEHOLDER_CONF #2703

jrief opened this Issue Feb 24, 2014 · 3 comments


None yet

3 participants

jrief commented Feb 24, 2014

How to reproduce:
Create a CMS plugin, say MyPlugin with require_parent = True and register it to the plugin_pool.

Ins, set:

     'named_placeholder': {
         'plugins': ['MyPlugin'],

Now, since this plugin may be added only to a list of allowed parents, and since placeholders never are allowed as parents (a bad design decision IMO), in the GUI, the list of plugins which can be added to the placeholder should be empty.
But instead, then every registered plugin can be added to the named_placeholder.

digi604 commented Feb 26, 2014

bad design: how would you solve it?
2nd point is valid and is a bug.

@digi604 digi604 added this to the 3.0 milestone Feb 26, 2014
jrief commented Feb 26, 2014

I would say, that if someone adds a plugin to the list of plugins, it is added regardless of its require_parent setting.
This can even be considered as consistent, because by adding it to the configuration, one knows that he explicitly violates this requirement. How do you feel about that?

yakky commented Mar 3, 2014

IMHO 'MyPlugin' should be ignored, possibly logging some kind of warning and an empty list shown (possibly with a message in the list area); allow the violation of a plugin explicity configuration it's not an option.
And if one feels like violating this rule, the plugin can be easily extended to be used outside any parent.

@jrief jrief added a commit to jrief/django-cms that referenced this issue Mar 4, 2014
@jrief jrief Fixed issue #2703 697c788
@jrief jrief referenced this issue Mar 4, 2014

Fix issue 2703 #2798

@digi604 digi604 closed this Mar 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment