collective / collective.facebook.accounts

This product allows you to associate Facebook accounts with a Plone site.
3 stars 2 forks source link

KeyError: 'collective.facebook.accounts' when adding an App ID/API Key #3

Closed markvl closed 12 years ago

markvl commented 12 years ago

When using collective.facebook.accounts version 1.0b2, I get the following error when trying to add an App ID (the first one):

2012-05-21T16:15:15 INFO Zope Ready to handle requests
------
2012-05-21T16:15:18 INFO collective.facebook.accounts Got a request with a token !
------
2012-05-21T16:15:18 INFO collective.facebook.accounts Token: AAAG...
------
2012-05-21T16:15:18 INFO collective.facebook.accounts URL to open: https://graph.facebook.com/me?access_token=AAAG...
------
2012-05-21T16:15:18 INFO collective.facebook.accounts Got a name: Mark van Lent
------
2012-05-21T16:15:18 ERROR Zope.SiteErrorLog 1337609718.990.548558172943 http://example.com/@@facebook-controlpanel
Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module collective.facebook.accounts.browser.controlpanel, line 194, in __call__
  Module plone.registry.registry, line 38, in __getitem__
KeyError: 'collective.facebook.accounts'

(For the record: I've shortened the token and replaced the actual domain name with example.com.)

The product works fine in version 1.0b1.

Just in case: using Plone 4.1.4, plone.app.registry 1.0 and plone.registry 1.0.

frapell commented 12 years ago

How did you install the product ? using portal_quickinstaller or portal_setup ? there's an issue that happens when you reinstall a product which uses the registry, where the old values get lost, that's why this product has an "initial" profile and a "default" one.

If you install the product using portal_setup, you should run the "initial" profile, and then the default.

hvelarde commented 12 years ago

we probably should add a note about that on the README file...

frapell commented 12 years ago

we should first know if this is actually the issue that happened to @markvl and if the install method mentioned, fixes it.

hvelarde commented 12 years ago

yes, you are right :-)

markvl commented 12 years ago

Oops, I indeed did not include how I installed the product; I didn't realise it would be important. Actually, it was neither of your suggestions: I had included profile-collective.facebook.portlets:default as dependency in the metadata.xml of my own product. (Which in turn depends on profile-collective.facebook.accounts:default.)

Adding the c.f.portlets:initial profile as a dependency indeed fixes the problem. Sorry, I did not see that coming. A hint in the README (of both this product and collective.facebook.portlets) would be nice. :)

Alternatively you could make sure that the initial profile is applied automatically (and once). This is code I used in one of my products to do just that: https://gist.github.com/2764233 (thanks to @mauritsvanrees).

hvelarde commented 12 years ago

ok, so I opened #4 for this; thanks for your input @markvl :-)