Products.PloneFormGen icon indicating copy to clipboard operation
Products.PloneFormGen copied to clipboard

BadRequest after adding a new thanks page if link integrity checking is enabled

Open datakurre opened this issue 13 years ago • 4 comments

It would be nice, if someone could confirm this:

  1. enable link integricy checking on your site
  2. add new form folder
  3. add new thanks page onto that folder
  4. get this
Traceback (innermost last):

Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Products.CMFPlone.FactoryTool, line 438, in __call__
Module Products.CMFPlone.FactoryTool, line 202, in __getitem__
Module Products.CMFPlone.FactoryTool, line 68, in _createObjectByType
Module Products.CMFCore.TypesTool, line 560, in _constructInstance
Module zope.event, line 31, in notify
Module zope.component.event, line 24, in dispatch
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module zope.component.event, line 32, in objectEventNotify
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module plone.app.linkintegrity.handlers, line 83, in modifiedArchetype
Module plone.app.linkintegrity.handlers, line 57, in getObjectsFromLinks
Module plone.app.linkintegrity.handlers, line 34, in findObject
Module OFS.Traversable, line 256, in unrestrictedTraverse
__traceback_info__: ([], '.')
Module Products.CMFPlone.FactoryTool, line 202, in __getitem__
Module Products.CMFPlone.FactoryTool, line 68, in _createObjectByType
Module Products.CMFCore.TypesTool, line 554, in _constructInstance
Module Products.PloneFormGen.content.thanksPage, line 4, in addFormThanksPage
Module OFS.ObjectManager, line 323, in _setObject
Module Products.CMFCore.PortalFolder, line 313, in _checkId
Module OFS.ObjectManager, line 98, in checkValidId
BadRequest: The id "." is invalid because it is not traversable.
  • Products. PloneFormGen == 1.7.0
  • plone.app.linkintegrity == 1.4.4

What happens

  1. plone.app.linkintegrity.handlers.modifiedArchetype gets fired by zope.lifecycleevent.IObjectCreatedEvent for new thanks page still under portal factory
  2. it founds <a title="Test Folder" href=".">visit the form</a> from noSubmitMessage
  3. it tries to traverse . under portal factory
  4. triggering it to try to create a yet another thanks page with id . (and failing)

If this can be confirmed, a quick fix would be to modify the default noSubmitMessage to be linkintegrity-safe, but eventually, I think, this should be fixed in plone.app.linkintegrity (I wonder, why it subscribes IObjectCreatedEvent for Archetypes instead of IObjectInitializedEvent).

datakurre avatar Nov 23 '11 09:11 datakurre

+1 Got that too...

jihaisse avatar Dec 07 '11 11:12 jihaisse

+1 got that too

amleczko avatar Jan 09 '12 15:01 amleczko

Fixed in 0c8da42..7a948ac. Will be in 1.7.1.

smcmahon avatar Feb 12 '12 22:02 smcmahon

I'm reopening this. The earlier fix takes care of new thank you pages, but doesn't cover copy/paste or import of old one that have relative links.

smcmahon avatar Feb 13 '12 21:02 smcmahon