#241: Clean up auto-sort, auto-order code

Contents
  1. Motivation
  2. Assumptions
  3. Proposal
  4. Implementation
  5. Deliverables
  6. Risks
  7. Progress log
  8. Participants
by Andreas Zeidler last modified Jan 21, 2010 07:28 AM

Clean up, i.e. remove all code related to auto-sorting / auto-ordering folder contents as this feature was implemented for Plone 2.1, but never got enabled. Basically this proposes to revert http://plone.org/products/atcontenttypes/roadmap/3

Proposed by
Andreas Zeidler
Proposal type
User interface, Architecture
Assigned to release
Repository branch
plip241-auto-sort-cleanup
State
completed

Motivation

Plone has come a long way and grown a lot of features doing so. This has also lead to a rather big code base, parts of which are unmaintained or even not used at all anymore. One such feature is the capability to automatically sort a folder's contents whenever a new item is added, changed or removed from the folder. The order can be set persistently on a per-folder basis.

However, while this seemed to be a desirable feature at the time, it was never quite completed, or perhaps just never activated. Longer-standing Plone contributors might be able to give more insight here.

As the code hasn't been changed significantly since the feature was put in place and there doesn't seem to be much demand for it either, this PLIP proposes to remove all related code. This would not only significantly slim down the code base, but also reduce complexity thereby making efforts like the folder unification much easier to implement and maintain long-term.

Assumptions

There are no pending plans to revive the auto-sorting feature.

Proposal

Recursively remove all code related to auto-sorting of folder contents as well as its otherwise unused dependencies. This also includes interfaces and tests.

Implementation

Starting at ATContentTypes/lib/autosort.py(164)manage_afterAdd() the commented out call should be removed, after which tools such as pyflakes can be used to recursively remove all unused code.

Deliverables

Versions of CMFPlone, ATContentTypes and Archetypes with all code related to auto-sorting removed. Local branches and notes about which parts need to be removed exist.

Risks

  • Existing Plone installations have modified the above mentioned manage_afterAdd method to enable the auto-sorting feature. Removing the code would break such installations on upgrade. Since enabling the feature cannot be done by just changing Plone's configuration, but does require local code changes, the number of sites using it is probably very low.
  • Existing 3rd-party products might be relying on parts of the code or interfaces to be removed and would therefore break during an upgrade of Plone.
  • However, being completely disabled clearly means the feature is currently unsupported, so while the above mentioned breakages are of course undesirable, they would not violate the goals for 3.x releases.

Progress log

The clean-up has been done on the above mentioned branch of ATContentTypes. A review bundle is provided at http://svn.plone.org/svn/plone/review/plip241-auto-sort-cleanup/

Participants

Andreas Zeidler