Skip to content

Commit

Permalink
Merge pull request #66 from plone/fix-rearrange
Browse files Browse the repository at this point in the history
Fix rearrange
  • Loading branch information
vangheem committed Dec 8, 2015
2 parents 58c258c + b0b19d0 commit 35754c8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
9 changes: 7 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ Changelog

New:

- *add item here*
- Ensure the base context allows ordering during rearranging.
[Gagaro]

Fixes:

- *add item here*
- Fixed rearranging for archetypes.
[Gagaro]

- Fixed error message displaying during rearranging.
[Gagaro]


3.0.14 (2015-11-26)
Expand Down
4 changes: 2 additions & 2 deletions plone/app/content/browser/contents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ def message(self, missing=[]):
translated_errors = [
translate(error, context=self.request) for error in self.errors
]
translated_msg = '{0:s}: {0:s}'.format(
translated_msg = u'{0:s}: {1:s}'.format(
translated_msg,
'\n'.join(translated_errors)
u'\n'.join(translated_errors)
)

return self.json({
Expand Down
9 changes: 8 additions & 1 deletion plone/app/content/browser/contents/rearrange.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from OFS.interfaces import IOrderedContainer
from plone.app.content.browser.contents import ContentsBaseAction
from plone.app.content.utils import json_loads
from plone.folder.interfaces import IExplicitOrdering
Expand All @@ -12,7 +13,13 @@ class OrderContentsBaseAction(ContentsBaseAction):
def getOrdering(self):
if IPloneSiteRoot.providedBy(self.context):
return self.context
ordering = self.context.getOrdering()
try:
ordering = self.context.aq_base.getOrdering()
except AttributeError:
if IOrderedContainer.providedBy(self.context):
# Archetype
return IOrderedContainer(self.context)
return None
if not IExplicitOrdering.providedBy(ordering):
return None
return ordering
Expand Down

0 comments on commit 35754c8

Please sign in to comment.