Ticket #8631 (closed Bug: fixed)
Getting a relation can cause a write transaction
| Reported by: | regebro | Owned by: | regebro |
|---|---|---|---|
| Priority: | minor | Milestone: | 3.3 |
| Component: | Unknown | Keywords: | |
| Cc: |
Description
Getting information is not expected to cause write transactions, but when getting relations of an object that does not have an intid, an intid will be created for it. This will cause a write transaction.
Worse, if you try to get relations for an object that is not supposed to get pickled, it will get pickled anyway. And if that object is not picklable, you will get an error.
This can happen for example if you have a portlet getting a special type of relations to show them, and you then add a portlet. Portlets use Zope3 type add forms, so the context for the portlet will in that case be a view. It won't have an intid, so it will get one, and at the transaction commit the view will get pickled, which will fail.
The solution to this is to not register an object when you try to get it's intid, but only if you create a relation with an object that does not have an intid.
Change History
comment:2 Changed 3 years ago by regebro
The problem basically is caused by this change: http://dev.plone.org/plone/changeset/17716
The question is what that is supposed to fix. We need to fix that some other way.
comment:3 Changed 3 years ago by regebro
- Status changed from assigned to closed
- Resolution set to fixed
OK, after conferring with alecm this has been reverted. This is to avoid getting an error when pre-existing content without an intid is assumed to have one. An upgrade step would be a better solution, alecm envisions one in five.intid.
