[Testbot] Plone 5.0 - Python 2.7 - Build # 1975 - Regression! - 12 failure(s)
jenkins at plone.org
jenkins at plone.org
Sun Mar 16 03:17:35 UTC 2014
-------------------------------------------------------------------------------
Plone 5.0 - Python 2.7 - Build # 1975 - Still Failing!
-------------------------------------------------------------------------------
http://jenkins.plone.org/job/plone-5.0-python-2.7/1975/
-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------
Repository: plone.schemaeditor
Branch: refs/heads/master
Date: 2014-03-15T19:25:02-07:00
Author: David Glick (davisagli) <david at glicksoftware.com>
Commit: https://github.com/plone/plone.schemaeditor/commit/fcfd4c21645a6c5f76b80911e3112105a0261398
add fieldsWhichCannotBeDeleted
Files changed:
M CHANGES.rst
M plone/schemaeditor/browser/schema/listing.py
M plone/schemaeditor/browser/schema/traversal.py
M plone/schemaeditor/configure.zcml
M plone/schemaeditor/interfaces.py
M plone/schemaeditor/tests/robot/test_fields.robot
M setup.py
diff --git a/CHANGES.rst b/CHANGES.rst
index 2c67139..c129243 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,8 +1,12 @@
Changelog
=========
-1.3.8 (unreleased)
-------------------
+2.0 (unreleased)
+----------------
+
+- Add fieldsWhichCannotBeDeleted attribute to SchemaContext, which can be
+ used to disallow removal of certain fields.
+ [davisagli]
- Fix removeField for EditableSchema to allow for the case where there
is no fieldset on the schema
diff --git a/plone/schemaeditor/browser/schema/listing.py b/plone/schemaeditor/browser/schema/listing.py
index 860ebab..0f84a52 100644
--- a/plone/schemaeditor/browser/schema/listing.py
+++ b/plone/schemaeditor/browser/schema/listing.py
@@ -72,6 +72,8 @@ def edit_url(self, field):
return '%s/%s' % (self.context.absolute_url(), field.__name__)
def delete_url(self, field):
+ if field.__name__ in self.context.fieldsWhichCannotBeDeleted:
+ return
return '%s/%s/@@delete' % (self.context.absolute_url(), field.__name__)
@button.buttonAndHandler(_(u'Save Defaults'))
diff --git a/plone/schemaeditor/browser/schema/traversal.py b/plone/schemaeditor/browser/schema/traversal.py
index 77956ca..715e9c3 100644
--- a/plone/schemaeditor/browser/schema/traversal.py
+++ b/plone/schemaeditor/browser/schema/traversal.py
@@ -19,6 +19,7 @@ class SchemaContext(SimpleItem):
schemaEditorView = None
additionalSchemata = ()
allowedFields = None # all fields
+ fieldsWhichCannotBeDeleted = ()
def __init__(self, context, request, name=u'schema', title=None):
super(SchemaContext, self).__init__(context, request)
diff --git a/plone/schemaeditor/configure.zcml b/plone/schemaeditor/configure.zcml
index 34bb330..620d685 100644
--- a/plone/schemaeditor/configure.zcml
+++ b/plone/schemaeditor/configure.zcml
@@ -4,6 +4,7 @@
xmlns:i18n="http://namespaces.zope.org/i18n"
i18n_domain="plone.schemaeditor">
+ <include package="plone.protect"/>
<include package="plone.z3cform"/>
<i18n:registerTranslations directory="locales"/>
diff --git a/plone/schemaeditor/interfaces.py b/plone/schemaeditor/interfaces.py
index 66fa2f6..6fb19f0 100644
--- a/plone/schemaeditor/interfaces.py
+++ b/plone/schemaeditor/interfaces.py
@@ -36,6 +36,10 @@ class ISchemaContext(IItem):
Or None to allow all fields.
""")
+ fieldsWhichCannotBeDeleted = Attribute(
+ """List of field names that may not be deleted from this schema."""
+ )
+
class ISchemaModifiedEvent(IObjectEvent):
diff --git a/plone/schemaeditor/tests/robot/test_fields.robot b/plone/schemaeditor/tests/robot/test_fields.robot
index aea70b0..853e2bc 100644
--- a/plone/schemaeditor/tests/robot/test_fields.robot
+++ b/plone/schemaeditor/tests/robot/test_fields.robot
@@ -105,6 +105,9 @@ Delete field
Click link css=div.fieldControls .schemaeditor-delete-field
Confirm Action
Page Should Not Contain Element css=#formfield-form-widgets-phone
+ # Make sure it actually got deleted
+ Go to ${PLONE_URL}/@@dexterity-types/somebody/@@fields
+ Page Should Not Contain Element css=#formfield-form-widgets-phone
#~ Reorder field
diff --git a/setup.py b/setup.py
index 2e64277..c59c119 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
-version = '1.3.8.dev0'
+version = '2.0.dev0'
setup(name='plone.schemaeditor',
version=version,
-------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHANGES.log
Type: application/octet-stream
Size: 4005 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140316/569c5503/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: application/octet-stream
Size: 204612 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140316/569c5503/attachment-0003.obj>
More information about the Testbot
mailing list