django-cms / djangocms-frontend

django CMS frontend is a plugin bundle for django CMS providing several components for the frontend, currently implemented with the popular Bootstrap 5 framework.
Other
48 stars 21 forks source link

Can not extend LinkPlugin as documented #95

Closed bielfrontera closed 1 year ago

bielfrontera commented 1 year ago

I've been following the documentation to extend the LinkPlugin. And I get this error when I try to add a LinkPlugin into a Page: django.core.exceptions.FieldError: Unknown field(s) (<name_of_new_field>) specified for Link. Check fields/fieldsets/exclude attributes of class LinkPlugin.

I've found that LinkForm does not inherit from a mixin_factory as other plugins do. Is this intentional or there will be no problem to include this inheritance at LinkForm?

fsbraun commented 1 year ago

Just by glimpsing at it, I believe the mixin_factory is missing. It should add the field to the form. Can you add a mixin_factory and test it?

bielfrontera commented 1 year ago

Yes, adding the mixin_factory solves the problem. I've run the tests, are they are ok (but I've found no test for theme extension and its not trivial to add one).

I'm preparing a PR with the change.