plone/plone.app.versioningbehavior — pull request #5 by lukasgraf (2014-06-05 08:41:13+00:00)
Title: Deal with AttributeError when trying to access fields provided by behaviors using attribute storage.

When using [schema-only behaviors with attribute storage](http://docs.plone.org/external/plone.app.dexterity/docs/behaviors/schema-only-behaviors.html#storing-attributes), default values for fields get initialized rather late - particularly at the time object creation events get fired (e.g. `ObjectAddedEvent`), those fields may not have been initialized yet with default values. In that situation, the attribute isn't present on the object yet, and trying to access it using `field.get()` will raise an `AttributeError`.

Since `field.get()` doesn't allow for providing a default value, this change wraps the field access in `getReferencedAttributes` with a `try...except AttributeError`.