diff --git a/CHANGES.rst b/CHANGES.rst index 8025f69..41e93af 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -21,6 +21,12 @@ Bug fixes: instead of Products.Five.testbrowser [davisagli] +- Fix test setup for Zope 4. + [davisagli] + +- Use __parent__ instead of aq_parent. + [davisagli] + 2.0.13 (2017-01-01) ------------------- diff --git a/plone/schemaeditor/browser/field/edit.py b/plone/schemaeditor/browser/field/edit.py index b6e5f57..c38dffa 100644 --- a/plone/schemaeditor/browser/field/edit.py +++ b/plone/schemaeditor/browser/field/edit.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- from Acquisition import aq_inner -from Acquisition import aq_parent from plone.autoform.form import AutoExtensibleForm from plone.schemaeditor import _ from plone.schemaeditor import interfaces @@ -123,7 +122,7 @@ def _schema(self): @lazy_property def additionalSchemata(self): - schema_context = self.context.aq_parent + schema_context = self.context.__parent__ return [v for k, v in getAdapters((schema_context, self.field), interfaces.IFieldEditorExtender)] @@ -165,14 +164,14 @@ def handleSave(self, action): IStatusMessage(self.request).addStatusMessage( self.noChangesMessage, type='info') - notify(SchemaModifiedEvent(self.context.aq_parent)) + notify(SchemaModifiedEvent(self.context.__parent__)) @button.buttonAndHandler(_(u'Cancel'), name='cancel') def handleCancel(self, action): self.redirectToParent() def redirectToParent(self): - parent = aq_parent(aq_inner(self.context)) + parent = aq_inner(self.context).__parent__ url = parent.absolute_url() if hasattr(parent, 'schemaEditorView') and parent.schemaEditorView: url += '/@@' + parent.schemaEditorView diff --git a/plone/schemaeditor/browser/field/fieldset.py b/plone/schemaeditor/browser/field/fieldset.py index cf1a919..d6fd34d 100644 --- a/plone/schemaeditor/browser/field/fieldset.py +++ b/plone/schemaeditor/browser/field/fieldset.py @@ -59,4 +59,4 @@ def change(self, fieldset_index): schema.moveField(field_name, new_position) notifyContainerModified(self.schema) - notify(SchemaModifiedEvent(self.aq_parent.aq_parent)) + notify(SchemaModifiedEvent(self.__parent__.__parent__)) diff --git a/plone/schemaeditor/browser/field/order.py b/plone/schemaeditor/browser/field/order.py index 9053f6c..e42bb80 100644 --- a/plone/schemaeditor/browser/field/order.py +++ b/plone/schemaeditor/browser/field/order.py @@ -45,7 +45,7 @@ def move(self, pos, fieldset_index): schema.moveField(fieldname, new_absolute_position) notifyContainerModified(self.schema) - notify(SchemaModifiedEvent(self.aq_parent.aq_parent)) + notify(SchemaModifiedEvent(self.__parent__.__parent__)) def delete(self): """ @@ -54,5 +54,5 @@ def delete(self): schema = IEditableSchema(self.schema) schema.removeField(self.field.getName()) notify(ObjectRemovedEvent(self.field, self.schema)) - notify(FieldRemovedEvent(self.aq_parent.aq_parent, self.field)) + notify(FieldRemovedEvent(self.__parent__.__parent__, self.field)) self.request.response.setHeader('Content-Type', 'application/json') diff --git a/plone/schemaeditor/tests/browser_testing.zcml b/plone/schemaeditor/tests/browser_testing.zcml index 6a8ec7d..bda61df 100644 --- a/plone/schemaeditor/tests/browser_testing.zcml +++ b/plone/schemaeditor/tests/browser_testing.zcml @@ -1,6 +1,12 @@ + xmlns:browser="http://namespaces.zope.org/browser" + xmlns:zcml="http://namespaces.zope.org/zcml"> + + + + +