plone / plone.app.ldap

Plone UI and integration of the functionality provided by LDAPMultiPlugins, LDAPUserFolder and PloneLDAP
3 stars 10 forks source link

Plone 5 compatibility #24

Open jkubaile opened 9 years ago

jkubaile commented 9 years ago

Hi,

i am trying to use plone.app.ldap in a Plone 5 environment. Installation via buildout was fine. Quick Installing in Plone works also. But using the control panel view and adding a new server or a new schema leads in the following error:

Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module Products.PDBDebugMode.runcall, line 71, in pdb_runcall
  Module ZPublisher.Publish, line 48, in call_object
  Module zope.formlib.form, line 800, in __call__
  Module zope.formlib.form, line 920, in render
  Module zope.formlib.form, line 790, in render
  Module plone.app.form._named, line 42, in __call__
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
  Module five.pt.engine, line 93, in __call__
  Module z3c.pt.pagetemplate, line 163, in render
  Module chameleon.zpt.template, line 257, in render
  Module chameleon.template, line 190, in render
  Module chameleon.template, line 172, in render
  Module 8a51f2b01b43baec52fa6a94857d1613d392a885.py, line 123, in render
  Module five.pt.expressions, line 154, in __call__
  Module five.pt.expressions, line 126, in traverse
  Module zope.traversing.adapters, line 136, in traversePathElement
   - __traceback_info__: (<Products.Five.metaclass.PropertyAdding object at 0x7fbae510aa90>, 'main_template')
  Module zope.traversing.adapters, line 50, in traverse
   - __traceback_info__: (<Products.Five.metaclass.PropertyAdding object at 0x7fbae510aa90>, 'main_template', ('macros', 'master'))
LocationError: (<Products.Five.metaclass.PropertyAdding object at 0x7fbae510aa90>, 'main_template')

 - Expression: "context/main_template/macros/master"
 - Filename:   ... pp.form-2.3.2-py2.7.egg/plone/app/form/addingpageform.pt
 - Location:   (5:23)
 - Source:     ... etal:use-macro="context/main_template/macros/master">
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Arguments:  repeat: {...} (0)
               template: <ViewPageTemplateFile - at 0x7fbae6ed6b10>
               views: <ViewMapper - at 0x7fbae499d090>
               modules: <instance - at 0x7fbaef769a70>
               args: <tuple - at 0x7fbafa641050>
               here: <ImplicitAcquisitionWrapper +ldapschema at 0x7fbae70d1e10>
               user: <ImplicitAcquisitionWrapper - at 0x7fbae70e2780>
               nothing: <NoneType - at 0x7b1070>
               container: <ImplicitAcquisitionWrapper +ldapschema at 0x7fbae70d1e10>
               request: <instance - at 0x7fbae6f00998>
               wrapped_repeat: <SafeMapping - at 0x7fbae4b65628>
               traverse_subpath: <list - at 0x7fbae3564560>
               default: <object - at 0x7fbafa617bc0>
               loop: {...} (0)
               context: <ImplicitAcquisitionWrapper +ldapschema at 0x7fbae70d1e10>
               view: <PropertyAddForm plone.LdapProperty at 0x7fbae510aad0>
               translate: <function translate at 0x7fbae4bc9410>
               root: <ImplicitAcquisitionWrapper Zope at 0x7fbae71bcf00>
               options: {...} (0)
               target_language: <NoneType - at 0x7b1070>

I would suggest, that it has something todo with the formlib based forms, which are used here. It was possible to set servers and schemas via the debugger. Than the access to the users and authentication seems to work also...

reinhardt commented 7 years ago

+1

jaroel commented 6 years ago

Here's a minimal Plone 5.1 buildout that makes this all work. We need the BBB import to exclude some CMFDefault bits, the p.a.form overrides, and we need to mark the views as ITraversable so we use (un)restrictedTraverse to get to the main_template.

[buildout]
parts = instance
extends =
    http://dist.plone.org/release/5.1rc2/versions.cfg
versions = versions

[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
eggs =
    Plone
    plone.app.ldap
    plone.app.form
zcml =
    Products.CMFPlone:meta-bbb.zcml
    plone.app.form
zcml-additional =
    <include package="plone.app.form" file="overrides.zcml" />
    <class class="plone.app.ldap.browser.baseform.Adding">
          <implements interface="OFS.interfaces.ITraversable" />
        </class>
tkimnguyen commented 5 years ago

I gave this minimal buildout a shot with Plone 5.1.5 but am getting these errors. It looks like it's trying to grab plone.app.ldap 1.4.3.


Installing client1.
Getting distribution for 'plone.app.form'.
warning: no previously-included files matching '*pyc' found anywhere in distribution
Got plone.app.form 2.3.2.
Version and requirements information containing zope.formlib:
  [versions] constraint on zope.formlib: 4.0.6
  Requirement of plone.app.form: zope.formlib>=4.0
  Requirement of webcouturier.dropdownmenu==3.0.2: zope.formlib
  Requirement of zope.formlib>=4.0: zope.datetime
  Requirement of zope.formlib>=4.0: zope.traversing
  Requirement of zope.formlib>=4.0: zope.security
  Requirement of zope.formlib>=4.0: zope.schema>=3.5.1
  Requirement of zope.formlib>=4.0: zope.publisher
  Requirement of zope.formlib>=4.0: zope.lifecycleevent
  Requirement of zope.formlib>=4.0: zope.interface
  Requirement of zope.formlib>=4.0: zope.i18nmessageid
  Requirement of zope.formlib>=4.0: zope.i18n
  Requirement of zope.formlib>=4.0: zope.event
  Requirement of zope.formlib>=4.0: zope.component
  Requirement of zope.formlib>=4.0: zope.browserpage>=3.11.0
  Requirement of zope.formlib>=4.0: zope.browser>=1.1
  Requirement of zope.formlib>=4.0: pytz
  Requirement of zope.formlib>=4.0: setuptools
  Requirement of five.formlib: zope.formlib>=4.4
  Requirement of five.formlib>=1.0.2: zope.formlib>=4.4
While:
  Installing client1.
Error: The requirement ('zope.formlib>=4.4') is not allowed by your [versions] constraint (4.0.6)
almeidajeff commented 5 years ago

Hi @tkimnguyen , I'm going through this same problem in Plone version 5.1.

Any palliative solution?

tkimnguyen commented 5 years ago

I haven't revisited this, and unfortunately I'm not recalling what I did to get around or over this (or if I just gave up).

almeidajeff commented 5 years ago

I ended up giving up too and ended up using pas.plugins.ldap