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

cross-database reference issue with collective.z3cform.datagridfield.registry.DictRow #97

Open
monroi opened this issue Feb 27, 2020 · 1 comment

Comments

@monroi
Copy link

monroi commented Feb 27, 2020

I tried to use DictRow to set a registry record in on eof my packages. Worked great when I installed the package on the first site, but got the following error when I tried to install the same package on a different site that's on a different database (different ZODB mount points on the same "buildout")

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 161, in transaction_pubevents
  Module transaction._manager, line 252, in commit
  Module transaction._manager, line 131, in commit
  Module transaction._transaction, line 311, in commit
  Module transaction._compat, line 50, in reraise
  Module transaction._transaction, line 302, in commit
  Module transaction._transaction, line 447, in _commitResources
  Module transaction._compat, line 50, in reraise
  Module transaction._transaction, line 421, in _commitResources
  Module ZODB.Connection, line 497, in commit
  Module ZODB.Connection, line 546, in _commit
  Module ZODB.Connection, line 578, in _store_objects
  Module ZODB.serialize, line 430, in serialize
  Module ZODB.serialize, line 439, in _dump
  Module ZODB.serialize, line 348, in persistent_id
ZODB.POSException.InvalidObjectReference: ("Database 'db11' doesn't allow implicit cross-database references", <Connection at 7f0698393748>, <collective.z3cform.datagridfield.registry.DictRow object at 0x7f063c96a048 oid 0x433a43 in <Connection at `7f069a60ee80>>)
@monroi
Copy link
Author

monroi commented Mar 12, 2020

A little bit more information on how to reproduce the error.
The interface

from collective.z3cform.datagridfield import DataGridFieldFactory
from plone.autoform import directives

class IBreadcrumb(model.Schema):
    breadcrumb_title = schema.TextLine(title=_("Title"), required=True)
    breadcrumb_url = schema.TextLine(title=_("URL"), required=True)

class IMyInterface(model.Schema):
    directives.widget(breadcrumbs=DataGridFieldFactory)
    breadcrumbs = schema.List(
        title=_("Additional settings"),
        value_type=DictRow(title=_("Breadcrumb"), schema=IBreadcrumb),
        required=False)

and in the registry.xml file

<registry>
    <records interface="ims.pathbar.interfaces.ICustomPathBar" />
</registry>

Now in order to reproduce the error

  1. Create two ZODB mount points in the ZMI. These databases must be configured to allow-implicit-cross-references=false
  2. Create a Plone site in each.
  3. Install the above profile on the first site
  4. Install the above profile on the second site - this produces the error

Restarting the Zope client allows the profile to be installed on the second site. It is unclear why this would ever try to make a cross db reference between these two sites. Perhaps some RAM cache with PersistentField?

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

1 participant