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

Error when adding sections container #6

Open
taut-and-yare opened this issue Feb 17, 2016 · 3 comments
Open

Error when adding sections container #6

taut-and-yare opened this issue Feb 17, 2016 · 3 comments

Comments

@taut-and-yare
Copy link

Hi,
And thanks for what seems to be a very useful plugin.

I get a 'NoneType' object is not iterable type error when trying to add a section container:

Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/en/?edit

Django Version: 1.8.9
Python Version: 2.7.9
Installed Applications:
('djangocms_admin_style',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'cms',
'menus',
'sekizai',
'treebeard',
'djangocms_text_ckeditor',
'djangocms_style',
'djangocms_column',
'djangocms_file',
'djangocms_googlemap',
'djangocms_inherit',
'djangocms_link',
'djangocms_picture',
'djangocms_teaser',
'djangocms_video',
'reversion',
'grounded_change',
'cmsplugin_sections')
Installed Middleware:
('cms.middleware.utils.ApphookReloadMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware')

Template error:
In template /Users/.../templates/fullwidth.html, error at line 7
'NoneType' object is not iterable

1 : {% extends "base.html" %}

2 : {% load cms_tags %}

3 :

4 : {% block title %}{% page_attribute "page_title" %}{% endblock title %}

5 :

6 : {% block content %}

7 : {% placeholder "content" %}

8 : {% endblock content %}

9 :

Traceback:
File "/Users/.../lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.             response = response.render()
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/response.py" in render
  2.         self.content = self.rendered_content
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/response.py" in rendered_content
  3.     content = template.render(context, self._request)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/backends/django.py" in render
  4.     return self.template.render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in render
  5.                 return self._render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in _render
  6.     return self.nodelist.render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in render
  7.             bit = self.render_node(node, context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/debug.py" in render_node
  8.         return node.render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  9.     return compiled_parent._render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in _render
  10.     return self.nodelist.render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in render
  11.             bit = self.render_node(node, context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/debug.py" in render_node
  12.         return node.render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/classytags/core.py" in render
  13.     return self.render_tag(context, **kwargs)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/sekizai/templatetags/sekizai_tags.py" in render_tag
  14.     rendered_contents = nodelist.render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in render
  15.             bit = self.render_node(node, context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/debug.py" in render_node
  16.         return node.render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/classytags/core.py" in render
  17.     return self.render_tag(context, **kwargs)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in render_tag
  18.     rendered_contents = nodelist.render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in render
  19.             bit = self.render_node(node, context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/debug.py" in render_node
  20.         return node.render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  21.             result = block.nodelist.render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in render
  22.             bit = self.render_node(node, context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/django/template/debug.py" in render_node
  23.         return node.render(context)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/classytags/core.py" in render
  24.     return self.render_tag(context, **kwargs)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in render_tag
  25.         content = get_placeholder_content(context, request, page, name, inherit, nodelist)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in get_placeholder_content
  26.     content = render_placeholder(placeholder, context, name)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/cms/plugin_rendering.py" in render_placeholder
  27. content.extend(render_plugins(plugins, context, placeholder, processors))
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/cms/plugin_rendering.py" in render_plugins
  28.     out.append(plugin.render_plugin(context, placeholder, processors=processors))
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/cms/models/pluginmodel.py" in render_plugin
  29.         context = plugin.render(context, instance, placeholder_slot)
    
    File "/Users/.../.virtualenvs/gc/lib/python2.7/site-packages/cmsplugin_sections/cms_plugins.py" in render
  30.     for child in instance.child_plugin_instances:
    

Exception Type: TypeError at /en/
Exception Value: 'NoneType' object is not iterable

@Atterratio
Copy link

Nofing?

@marcelox
Copy link

Hello, I have the same problem when adding a section container (my versions: django 1.8.12, djangocms 3.2.3), thank you

@taut-and-yare
Copy link
Author

@Atterratio I ended up writing my own plugin in the end.. @marcelox You need to add an if statement before the 2 for loops inside cmsplugins.py to make sure instance.child_plugin_instances is not None, so it doesn't try to iterate when there are no sections in the container yet. It is fixed already in one of the branches I believe.

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

No branches or pull requests

3 participants