plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
243 stars 186 forks source link

Problem with @@plone-addsite and INonInstallable without getNonInstallableProfiles method. #3862

Closed thet closed 9 months ago

thet commented 10 months ago

When adding a Plone site with @@plone-addsite and a custom add-on with a Products.CMFPlone.interface.INonInstallable utility which has a getNonInstallableProfiles method but not a getNonInstallableProfiles, you'll get an error like this:


2023-10-19 15:40:27,133 ERROR   [Zope.SiteErrorLog:252][waitress-2] 1697722827.132640.061328476540823074 http://localhost:6060/@@plone-addsite
Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 176, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 385, in publish_module
  Module ZPublisher.WSGIPublisher, line 280, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 63, in call_object
  Module Products.CMFPlone.browser.admin, line 278, in __call__
  Module Products.Five.browser.pagetemplatefile, line 126, in __call__
  Module Products.Five.browser.pagetemplatefile, line 58, in __call__
  Module zope.pagetemplate.pagetemplate, line 133, in pt_render
  Module Products.PageTemplates.engine, line 378, in __call__
  Module z3c.pt.pagetemplate, line 176, in render
  Module chameleon.zpt.template, line 302, in render
  Module chameleon.template, line 215, in render
  Module chameleon.utils, line 53, in raise_with_traceback
  Module chameleon.template, line 192, in render
  Module c10ba7607eb6c62b516ecb500b8e3d0b, line 372, in render
  Module zope.tales.expressions, line 250, in __call__
  Module Products.PageTemplates.Expressions, line 225, in _eval
  Module Products.PageTemplates.Expressions, line 155, in render
  Module Products.CMFPlone.browser.admin, line 153, in profiles
AttributeError: 'HideEuphorieProducts' object has no attribute 'getNonInstallableProfiles'

 - Expression: "view/profiles"
 - Filename:   ... egg/Products/CMFPlone/browser/templates/plone-addsite.pt
 - Location:   (line 37: col 29)
 - Source:     tal:define="profiles view/profiles;
                                    ^^^^^^^^^^^^^
 - Arguments:  template: <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7f32bede26d0>
               options: {}
               args: ()
               nothing: None
               modules: <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter object at 0x7f32c55da0d0>
               request: <WSGIRequest, URL=http://localhost:6060/@@plone-addsite>
               view: <Products.Five.browser.metaconfigure.SimpleViewClass from /home/_thet/repos-config/dotfiles-thet/dot.buildout/eggs/Products.CMFPlone-5.2.14-py3.8.egg/Products/CMFPlone/browser/templates/plone-addsite.pt object at 0x7f32c149b4f0>
               context: <Application at >
               views: <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7f32c149be20>
               here: <Application at >
               container: <Application at >
               root: <Application at >
               traverse_subpath: []
               user: <User 'admin'>
               default: <DEFAULT>
               repeat: <Products.PageTemplates.engine.RepeatDictWrapper object at 0x7f32c23ec6c0>
               loop: {}
               target_language: None
               translate: <function BaseTemplate.render.<locals>.translate at 0x7f32bec4c430>
               attrs: {'action': '#', 'method': 'post'}
2023-10-19 15:41:59,570 ERROR   [Zope.SiteErrorLog:252][waitress-3] 1697722919.56902150.9549805703076303 http://localhost:6060/@@plone-addsite
Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 176, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 385, in publish_module
  Module ZPublisher.WSGIPublisher, line 280, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 63, in call_object
  Module Products.CMFPlone.browser.admin, line 278, in __call__
  Module Products.Five.browser.pagetemplatefile, line 126, in __call__
  Module Products.Five.browser.pagetemplatefile, line 58, in __call__
  Module zope.pagetemplate.pagetemplate, line 133, in pt_render
  Module Products.PageTemplates.engine, line 378, in __call__
  Module z3c.pt.pagetemplate, line 176, in render
  Module chameleon.zpt.template, line 302, in render
  Module chameleon.template, line 215, in render
  Module chameleon.utils, line 53, in raise_with_traceback
  Module chameleon.template, line 192, in render
  Module c10ba7607eb6c62b516ecb500b8e3d0b, line 372, in render
  Module zope.tales.expressions, line 250, in __call__
  Module Products.PageTemplates.Expressions, line 225, in _eval
  Module Products.PageTemplates.Expressions, line 155, in render
  Module Products.CMFPlone.browser.admin, line 153, in profiles
AttributeError: 'HideEuphorieProducts' object has no attribute 'getNonInstallableProfiles'

 - Expression: "view/profiles"
 - Filename:   ... egg/Products/CMFPlone/browser/templates/plone-addsite.pt
 - Location:   (line 37: col 29)
 - Source:     tal:define="profiles view/profiles;
                                    ^^^^^^^^^^^^^
 - Arguments:  template: <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7f32bede26d0>
               options: {}
               args: ()
               nothing: None
               modules: <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter object at 0x7f32c55da0d0>
               request: <WSGIRequest, URL=http://localhost:6060/@@plone-addsite>
               view: <Products.Five.browser.metaconfigure.SimpleViewClass from /home/_thet/repos-config/dotfiles-thet/dot.buildout/eggs/Products.CMFPlone-5.2.14-py3.8.egg/Products/CMFPlone/browser/templates/plone-addsite.pt object at 0x7f32c12e05e0>
               context: <Application at >
               views: <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7f32c12e0520>
               here: <Application at >
               container: <Application at >
               root: <Application at >
               traverse_subpath: []
               user: <User 'admin'>
               default: <DEFAULT>
               repeat: <Products.PageTemplates.engine.RepeatDictWrapper object at 0x7f32c6d90380>
               loop: {}
               target_language: None
               translate: <function BaseTemplate.render.<locals>.translate at 0x7f32bf7b6790>
               attrs: {'action': '#', 'method': 'post'}