Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

create content_type: jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'is_plone5'

Đang mở
#69 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

Reproduce the content-type creation flow with the reported Plone CLI and Python versions, then trace the call from plonecli/cli.py through mrbob/configurator.py and mrbob/rendering.py. Inspect the template location reported as line 17 and the variables passed to Jinja2; done means the command completes without the is_plone5 UndefinedError.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

  • Plone CLI version: 2.1.2
  • Python version: 3.6.9
  • Operating System: Ubuntu 18.04
Description

I was trying to add a content type to a package previously created by plonecli.

What I Did
--> Content type name (Allowed: _ a-z A-Z and whitespace) [Todo Task]: PSD X Tool

--> Content type description: 

--> Use XML Model [y]: n

--> Dexterity base class (Container/Item) [Container]: Item

--> Should the content type globally addable? [y]: 

--> Create a content type class [y]: 

--> Activate default behaviors? [y]: n


Traceback (most recent call last):
  File "/usr/local/plone-5.2/zeoserver/bin/plonecli", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/click/core.py", line 1289, in invoke
    rv.append(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/plonecli/cli.py", line 91, in create
    mrbobmain([bobtemplate, "-O", name])
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/mrbob/cli.py", line 175, in main
    c.render()
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/mrbob/configurator.py", line 193, in render
    self.ignored_directories)
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/mrbob/rendering.py", line 82, in render_structure
    renderer,
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/mrbob/rendering.py", line 102, in render_template
    output = renderer(source_output, variables)
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/mrbob/rendering.py", line 22, in <lambda>
    jinja2_renderer = lambda s, v: jinja2_env.from_string(s).render(parse_variables(v))
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/local/plone-5.2/zeoserver/lib/python3.6/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 17, in top-level template code
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'is_plone5'```
Ngôn ngữ chính
Python
Star
20
Fork
12
Merge trung bình
11 ngày 13 giờ
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của plone/plonecli

Tất cả issue của plone/plonecli

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.