No acquistion during publish traverse
The problem with “acquisition” and publishTraverse is that the current method returns too many different URLs for the same content. For instance here is some potential url for the “kb” page of the plone.org website
and here is a generic “Plone” site with two content items “a” and “b” (folderish or not)
All the urls above returns 200 with the same content, while I would like the “canonical url” to return 200 and the other to return 404.
The behaviour described above constitute a problem because:
This is a monkey patch for publishTraverse method of Zope2’s ZPublisher.BaseRequest.DefaultPublishTraverse and a monkey patch for Products.Archetypes.BaseObject.BaseObject.__bobo_traverse__
By default invalid traverse are only logged as warning.
For enable raising exceptions, you need to manually modify config.py changing DRYRUN to False.
Or using plone.recipe.zope2instance >= 4.2.14, e.g.:
[instance] recipe = plone.recipe.zope2instance eggs = experimental.noacquisition ... initialization = from experimental.noacquisition import config config.DRYRUN = False
USE AT YOUR OWN RISK
Don’t use it, if you don’t know exactly what are you doing… at least use leaving DRYRUN = True.
There is a more elegant solution in a branch of Products.CMFPlone, that makes use of IPubAfterTraversal event instead of a monkey patch. But seems that currently it doesn’t works for all cases, at least when there is a custom traversal at the end of the request (take a look at the tests inside this package). https://github.com/plone/Products.CMFPlone/tree/publication-through-explicit-acquisition
There is also another package with same approach as CMFPlone’s branch: https://github.com/collective/collective.explicitacquisition