Sooo. The last problem (TestATNewsItemFunctional) is not real-life issue since adding Archetypes News Items works fine with and without the modified response in the redirect. I spent most of today trying to find the cause and first had a couple of fistfights with CMFFormController (please die already!) and the Controller Python Script
createObject.cpy which is used in that test. Turns out that was not the issue.
The issue is actually really the space in "News Item". Since https://github.com/zopefoundation/Zope/commit/ca445a661d3992352f76266009798c9305d834db#diff-80f3a2c3ed7611b843ad03eda4878084R218 the url gets url-quoted. That turns
News Item to
ZPublisher.BaseRequest.BaseRequest.traverse the step
News%20Item is then quoted again, resulting in
Then when Plone tries to traverse from
News%20Item the item is not found:
(Pdb++) self.traverseName(object, 'News%20Item')
*** AttributeError: News%20Item
(Pdb++) self.traverseName(object, 'News%2520Item')
*** AttributeError: News%2520Item
(Pdb++) self.traverseName(object, 'News Item')
<TempFolder at /plone/Members/test_user_1_/portal_factory/News Item>
The same happens when using unrestrictedTraverse.
That finally led me down to
Products.ATContentTypes.tool.factory.FactoryTool.__bobo_traverse__. That's a rather simple method that returns a temporary folder to hold the new item during creation but the
%20 prevente it from finding the type.
Fixed in https://github.com/plone/Products.ATContentTypes/pull/63
I learned again:
- Disable handle_errors in functional tests.
- If you persist and do not hurry you might eventually find the issue.
- Expect custom
__bobo_traverse__ methods in all kinds of places. Expect bug in them to be swallowed.