Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Grid compatibility for django CMS v4 plugin architecture #126

Merged

Conversation

Aiky30
Copy link

@Aiky30 Aiky30 commented Nov 25, 2020

Fixes the following error thrown when trying to create a plugin using the bootstrap grid:

AttributeError at /admin/cms/placeholder/add-plugin/
'Bootstrap4GridRow' object has no attribute 'numchild'

@crydotsnake
Copy link
Contributor

TODO:
Error when adding the Link/Button plugin too the page

Bildschirmfoto 2021-04-02 um 15 50 53

Error Log:

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/admin/cms/placeholder/add-plugin/?placeholder_id=3&plugin_type=Bootstrap4LinkPlugin&cms_path=/admin/cms/placeholder/object/5/edit/2/&plugin_language=en&plugin_position=9

Django Version: 2.2
Python Version: 3.8.8
Installed Applications:
['quickstart',
 'djangocms_admin_style',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'cms',
 'menus',
 'treebeard',
 'sekizai',
 'filer',
 'easy_thumbnails',
 'djangocms_versioning',
 'djangocms_alias',
 'djangocms_text_ckeditor',
 'djangocms_file',
 'djangocms_icon',
 'djangocms_link',
 'djangocms_url_manager',
 'djangocms_picture',
 'djangocms_style',
 'djangocms_googlemap',
 'djangocms_video',
 'djangocms_bootstrap4',
 'djangocms_bootstrap4.contrib.bootstrap4_alerts',
 'djangocms_bootstrap4.contrib.bootstrap4_badge',
 'djangocms_bootstrap4.contrib.bootstrap4_card',
 'djangocms_bootstrap4.contrib.bootstrap4_carousel',
 'djangocms_bootstrap4.contrib.bootstrap4_collapse',
 'djangocms_bootstrap4.contrib.bootstrap4_content',
 'djangocms_bootstrap4.contrib.bootstrap4_grid',
 'djangocms_bootstrap4.contrib.bootstrap4_jumbotron',
 'djangocms_bootstrap4.contrib.bootstrap4_link',
 'djangocms_bootstrap4.contrib.bootstrap4_listgroup',
 'djangocms_bootstrap4.contrib.bootstrap4_media',
 'djangocms_bootstrap4.contrib.bootstrap4_picture',
 'djangocms_bootstrap4.contrib.bootstrap4_tabs',
 'djangocms_bootstrap4.contrib.bootstrap4_utilities']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'whitenoise.middleware.WhiteNoiseMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware',
 'cms.middleware.language.LanguageCookieMiddleware']



Traceback:

File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.8/site-packages/django/utils/decorators.py" in _wrapped_view
  142.                     response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python3.8/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python3.8/site-packages/django/contrib/admin/sites.py" in inner
  223.             return view(request, *args, **kwargs)

File "/usr/local/lib/python3.8/site-packages/django/views/decorators/clickjacking.py" in wrapped_view
  33.         resp = view_func(*args, **kwargs)

File "/usr/local/lib/python3.8/site-packages/cms/admin/placeholderadmin.py" in add_plugin
  375.         response = plugin_instance.add_view(request)

File "/usr/local/lib/python3.8/site-packages/django/contrib/admin/options.py" in add_view
  1634.         return self.changeform_view(request, None, form_url, extra_context)

File "/usr/local/lib/python3.8/site-packages/django/utils/decorators.py" in _wrapper
  45.         return bound_method(*args, **kwargs)

File "/usr/local/lib/python3.8/site-packages/django/utils/decorators.py" in _wrapped_view
  142.                     response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python3.8/site-packages/django/contrib/admin/options.py" in changeform_view
  1522.             return self._changeform_view(request, object_id, form_url, extra_context)

File "/usr/local/lib/python3.8/site-packages/django/contrib/admin/options.py" in _changeform_view
  1575.                 form = ModelForm(initial=initial)

File "/usr/local/lib/python3.8/site-packages/djangocms_link/cms_plugins.py" in __init__
  67.                 self.for_site(site)

File "/usr/local/lib/python3.8/site-packages/djangocms_link/forms.py" in for_site
  21.         self.fields['internal_link'].queryset = Page.objects.drafts().on_site(site)

Exception Type: AttributeError at /admin/cms/placeholder/add-plugin/
Exception Value: 'PageManager' object has no attribute 'drafts'

@Aiky30 Aiky30 changed the title WIP: Forward compatibility for django CMS v4 feat: Forward compatibility for django CMS v4 Oct 10, 2021
@Aiky30 Aiky30 changed the title feat: Forward compatibility for django CMS v4 fix: Grid compatibility for django CMS v4 plugin architecture Oct 10, 2021
@Aiky30
Copy link
Author

Aiky30 commented Oct 10, 2021

@crydotsnake Your issue raised here has been moved to a separate issue to help unblock the changes fixed in this PR.

#139

@Aiky30 Aiky30 changed the base branch from master to support/django-cms-4.0.x October 10, 2021 15:35
@marksweb marksweb merged commit 12b7bd6 into django-cms:support/django-cms-4.0.x Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants