Skip to content

Commit

Permalink
Revert declaring cover_layout field in content type schema as readonly (
Browse files Browse the repository at this point in the history
#762)

* Revert declaring cover_layout field in content type schema as readonly

* Do no change anything under Plone 5

Products.TinyMCE is not used in Plone 5 and we are not running RF tests neither.
  • Loading branch information
hvelarde authored Oct 30, 2017
1 parent a42fe23 commit e3dd13a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ There's a frood who really knows where his towel is.
1.6b4 (unreleased)
^^^^^^^^^^^^^^^^^^

- Nothing changed yet.
- Revert declaring ``cover_layout`` field in content type schema as ``readonly`` (fixes `#761 https://github.com/collective/collective.cover/issues/761`_).
[hvelarde]


1.6b3 (2017-10-23)
Expand Down
6 changes: 4 additions & 2 deletions src/collective/cover/models/cover.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
<default>Empty layout</default>
</field>

<field name="cover_layout" type="zope.schema.Text">
<field name="cover_layout" type="zope.schema.Text"
form:omitted="z3c.form.interfaces.IForm:true
z3c.form.interfaces.IAddForm:true
z3c.form.interfaces.IEditForm:true">
<description i18n:translate=""
>The layout to be used to render groups and tiles</description>
<title i18n:translate="">Cover Layout</title>
<readonly>True</readonly>
</field>

</schema>
Expand Down
10 changes: 10 additions & 0 deletions src/collective/cover/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ def generate_jpeg(width, height):
return output


# FIXME: workaround for https://github.com/plone/plone.app.testing/issues/39
# Products.TinyMCE is used only in Plone 4
if not IS_PLONE_5:
autoform = ('plone.autoform', {'loadZCML': True})
tinymce = ('Products.TinyMCE', {'loadZCML': True})
products = list(PLONE_FIXTURE.products)
products.insert(products.index(tinymce), autoform)
PLONE_FIXTURE.products = tuple(products)


class Fixture(PloneSandboxLayer):

defaultBases = (PLONE_FIXTURE,)
Expand Down

0 comments on commit e3dd13a

Please sign in to comment.