Closed claytonc closed 6 years ago
[1] https://github.com/plone/plone.portlets/blob/2.3/plone/portlets/utils.py#L66
I didn't fix because I don't know why did they use "decode()" at line 66.
https://github.com/plone/plone.app.portlets/blob/2.5.6/plone/app/portlets/utils.py#L42
path = key.encode() ?
maybe because the use encode
here? https://github.com/plone/plone.portlets/blob/2.3/plone/portlets/utils.py#L56
I didn't fix because I don't know why did they use "decode()" at line 66.
Using "blame" it seems to be Python 3 support https://github.com/plone/plone.portlets/blame/2.3/plone/portlets/utils.py#L66. Maybe @davisagli can give us a hint here.
Confirmed. Plone 5.0 is using plone.portlets 2.3.3 and branch 2.2.x. See https://github.com/plone/buildout.coredev/pull/284. We should do the same should happen on 4.3: it is currently using a newer plone.portlets than 5.0, which is of course silly. I will fix that.
Summary: you can fix this in individual projects by pinning plone.portlets = 2.2.3
.
BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)
What I did:
Adding a calendar portlet to the root of the site works well.
What I expect to happen:
Calendar portlet showing next or previous month
What actually happened:
KeyError: u'Cannot find object at path folder-1'
What version of Plone/ Addons I am using:
Plone 4.3.14 no addons.
The error occurs from the version of Plone 4.3.12 and using plone.portlets == 2.3.
Debugging I discovered that the error occurs because the path is being passed as string unicode:
u'/Plone/folder-1'. [1]
For example [2]:
context.restrictedTraverse(u'/Plone/folder-1') ==> *** KeyError: u '/'
[1] https://github.com/plone/plone.portlets/blob/2.3/plone/portlets/utils.py#L66 [2] https://github.com/plone/plone.app.portlets/blob/2.5.6/plone/app/portlets/utils.py#L55