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

Failure on Plone 4.3: "NameError: name 'FolderView' is not defined" #59

Open
adaugherity opened this issue Apr 14, 2016 · 3 comments
Open

Comments

@adaugherity
Copy link

This affects Solgema.fullcalendar 2.3.5 and 2.3.6; if I pin it to 2.3.4 everything is fine. Running on Plone 4.3.7.

With these versions, Zope fails to start; here is the relevant output of bin/client1 fg:

  File "/opt/plone4/buildout-cache/eggs/Solgema.fullcalendar-2.3.6-py2.7.egg/Solgema/fullcalendar/browser/views.py", line 172, in <module>
    class SolgemaFullcalendarDxView(FolderView, SolgemaFullcalendarView):
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/opt/plone4/plone4_dev/parts/client1/etc/site.zcml", line 16.2-16.23
    ZopeXMLConfigurationError: File "/opt/plone4/buildout-cache/eggs/Products.CMFPlone-4.3.7-py2.7.egg/Products/CMFPlone/configure.zcml", line 98.4-102.10
    ZopeXMLConfigurationError: File "/opt/plone4/buildout-cache/eggs/Solgema.fullcalendar-2.3.6-py2.7.egg/Solgema/fullcalendar/configure.zcml", line 24.2-24.31
    ZopeXMLConfigurationError: File "/opt/plone4/buildout-cache/eggs/Solgema.fullcalendar-2.3.6-py2.7.egg/Solgema/fullcalendar/browser/configure.zcml", line 21.2-29.8
    NameError: name 'FolderView' is not defined

Looking at recent commits, it appears there was work done with folder views that uses plone.app.contenttypes, which I do not have in my buildout. Is that a dependency of Solgema.fullcalendar now, or is the "don't have p.a.contenttypes" code path broken?

@pgrunewald
Copy link

Experiencing the same issue. I guess that this commit introduced a hidden dependency to plone.app.contenttypes >= 1.1.x. This will break for all Plone 4.x sites that make no use of Dexterity whatsoever.

Maybe @bsuttor can give some insight for this issue?

@bsuttor
Copy link
Member

bsuttor commented Sep 14, 2016

Indeed, It seems my commit was a little to early.

Maybe adding a zmcl:condition like this will fix it ?

<browser:page zcml:condition="installed plone.app.contenttypes"
       for="plone.app.contenttypes.interfaces.IFolder"
       name="solgemafullcalendar_view"

@pgrunewald
Copy link

pgrunewald commented Sep 14, 2016

Good thinking, but it's unfortunately not the solution. The file view.py is also included by other browser:page/ statements. Those specific folder and collections views probably should be migrated into dx.py, which is already constrained by the existence of Dexterity.

Update: Migrated the relevant code into dx.py. It is still imported, since plone.dexterity seems to be present anyway in Plone 4.x. So I guess, we need do split the view classes more finegrained into separate files.

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