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

jsonify.get_item() fails due to AttributeError exception with isDiscussionAllowedFor #8

Closed
mcv21 opened this issue Sep 12, 2013 · 2 comments

Comments

@mcv21
Copy link

mcv21 commented Sep 12, 2013

Hi,

I'm using Plone 4.2.5. When I attempt to use get_item() against anything in my site, I see the following:

from collective.jsonify import get_item
site=app['SITENAME']
print get_item(site['foo'])

results in the following:

ERROR: exception wrapping object: isDiscussionAllowedFor
['  File "/home/mcv21/falconsvn/light/src/collective.jsonify/collective/jsonify/methods.py", line 29, in get_item\n    context_dict = Wrapper(self)\n',
 '  File "/home/mcv21/falconsvn/light/src/collective.jsonify/collective/jsonify/wrapper.py", line 25, in __init__\n    getattr(self, method)()\n',
 '  File "/home/mcv21/falconsvn/light/src/collective.jsonify/collective/jsonify/wrapper.py", line 365, in get_archetypes_fields\n    value = self._get_at_field_value(field)\n',
 '  File "/home/mcv21/falconsvn/light/src/collective.jsonify/collective/jsonify/wrapper.py", line 334, in _get_at_field_value\n    return getattr(self.context, field.accessor)()\n',
 '  File "/home/mcv21/zope/eggs/Products.Archetypes-1.8.6-py2.7.egg/Products/Archetypes/ExtensibleMetadata.py", line 245, in isDiscussable\n    return dtool.isDiscussionAllowedFor(self)\n']

After some discussion on plone-users, Daniel Jowett suggested I try his fork of this code, https://github.com/djowett/collective.jsonify/ which has a few differences in how it handles archetypes fields. That works fine, though I'm not sure exactly what the necessary change is, and I'm guessing you can run git diff as well as I can ;-)

Thanks,

Matthew

@djowett
Copy link
Contributor

djowett commented Feb 23, 2015

Hi @mcv21,
are you in a position to try rerunning this against master to check if it's fixed there? @thet has kindly merged in my code, so it should run OK.

Cheers,
Daniel

@thet
Copy link
Member

thet commented May 15, 2015

Might be fixed...

@thet thet closed this as completed May 15, 2015
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