[Zope-CMF] Copy & Paste bug?

Tres Seaver tseaver@zope.com
22 Oct 2002 15:51:12 -0400


On Tue, 2002-10-22 at 14:47, Dieter Maurer wrote:
> Chris Withers writes:
>  > If you copy and paste a whole CMF site, why does the new copy have all the 
>  > content from the old site indexed in it, in addition to the content from the new 
>  > copy?
> The copy copies "portal_catalog" (including its content).
> The paste calls "manage_afterAdd" for all objects. This catalogs them.
> It's not easy to avoid this.

I would be opposed to introducing any complexity in an attempt to
prevent this behavior:  it is definitely an "edge" use case, and
has a fairly simple workaround.  We could add a method to the
CMFCore.PortalCatalog to canonicalize the workaround (which is to
remove any RUIDs whose prefix doesn't match the parent's physical
path), or just leave it unaddressed.

One alternative would be to use only the "site-relative" portion of
the object's physical path as the RUID;  forward compatibility is the
only real gotcha here, unless people have real use cases for cataloguing
content outside the CMFSite.  This alternative actually "reduces"
complexity, and makes the "move the CMFSite" use case work "for free"
(content gets needlessly re-indexed, but who cares?)

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com