Ticket #4224 (closed Bug: fixed)

Opened 7 years ago

Last modified 3 years ago

Cannot reorder in ZMI

Reported by: guitaristx Owned by:
Priority: minor Milestone: 2.5
Component: Templates/CSS Version:
Severity: Keywords:
Cc:

Description (last modified by hannosch) (diff)

I cannot reorder the items at the root of a plone site in the ZMI. it always yields a status message stating '0 items moved'.

Change History

comment:1 Changed 7 years ago by shh

Portal (or anything else for that matter) MUST NOT derive from OFS.OrderSupport. This also means no ordering controls in the ZMI!

comment:2 Changed 7 years ago by shh

Damn, damn, damn, of course Portal is derived from PortalFolder is derived from OFS.OrderSupport. To top it off, the ZMI only tests for the presence of 'has_order_support', not for its (boolean) value. OMFG!

To answer you Q guitaristx, you can only move content objects. That's how ordering works in Plone.

comment:3 Changed 7 years ago by shh

  • Status changed from new to closed
  • Resolution set to fixed

Fixed by r7478.

comment:4 Changed 7 years ago by guitaristx

" ... you can only move content objects. That's how ordering works in Plone."

I would still call this a usability bug, since this means that the ordering of the tools and such in the ZMI is rather arbitrary. In Plone 2.0.x the tools were arranged alphabetically. The behavior I reported makes using the ZMI needlessly difficult.

comment:5 Changed 7 years ago by tiran

  • Status changed from closed to new
  • Resolution fixed deleted

I have a fix the issue that it is impossible to reorder non content objects. I'm going to talk to the CMF guys to include them and I will add the fix to AT once it is tested.

Code:

security.declareProtected(CMFCorePermissions.ModifyPortalContent,

'moveObjectsByDelta')

def moveObjectsByDelta(self, ids, delta, subset_ids=None):

""" Move specified sub-objects by delta.

If no subset_ids is given and all the ids are pointing to content objects moveObjectsByDelta() will skip all non content objects. """ if isinstance(ids, basestring):

ids = (ids,)

if subset_ids is None:

# we want to use only content objects as subset unless one # or more ids are not in the subset of content ids. That should # only happen when trying to move a non contentish object # like a tool or script. _objects = self._objects cmf_subset_ids = self.getCMFObjectsSubsetIds(_objects) for id in ids:

if id not in cmf_subset_ids:

break

else:

subset_ids = cmf_subset_ids

return OrderSupport.moveObjectsByDelta(self, ids, delta, subset_ids=None)

security.declarePrivate('getCMFObjectsSubsetIds')

def getCMFObjectsSubsetIds(self, _objects):

"""Get the ids of only cmf objects (used for moveObjectsByDelta) """ ttool = getToolByName(self, 'portal_types') meta_types = {} for ti in ttool.listTypeInfo():

meta_types[ti.Metatype()] = 1

type_mts = meta_types.keys() return [objid? for obj in _objects if objmeta_type? in type_mts ]

comment:6 Changed 7 years ago by shh

guitaristx: I doesn't look like you have tried r7478 yet.

tiran: Perhaps, but not now, please. We have to get rid of our own OrderSupport. But not for 2.1.

comment:7 Changed 6 years ago by hannosch

  • Status changed from new to closed
  • Resolution set to fixed
  • Description modified (diff)

The ZMI looks beautiful again, and I really don't see why you should need to order non-content-objects.

comment:8 Changed 3 years ago by hannosch

  • Component changed from Usability to Templates/CSS
Note: See TracTickets for help on using tickets.