AttributeError with PAM on Plone 4.3.20

Hi Plone,

I want to use plone.app.multilingual on Plone 4.3.20. I installed PAM version 2.x from GitHub. PAM seems to work fine, but it prevents deleting the Plone site from the Zope instance. When I attempt to delete the Plone site with PAM in the buildout, I encounter the following issue:

Error Type: AttributeError
Error Value: 'NoneType' object has no attribute 'unrestrictedSearchResults'

This is the traceback:

Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module OFS.ObjectManager, line 539, in manage_delObjects
  Module OFS.ObjectManager, line 407, in _delObject
  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 OFS.subscribers, line 113, in dispatchObjectMovedEvent
  Module zope.container.contained, line 153, in dispatchToSublocations
  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 archetypes.multilingual.subscriber, line 113, in archetypes_creation_handler
  Module plone.app.multilingual.subscriber, line 116, in set_recursive_language
  Module plone.app.multilingual.manager, line 95, in update
 AttributeError: 'NoneType' object has no attribute 'unrestrictedSearchResults'

Can I leave it this way and accept the fact that the Plone site cannot be deleted from the instance, or is this something that needs to be fixed before continuing? If it needs a fix, how?

Thank you in advance

J

Juron via Plone Community wrote at 2024-2-20 16:15 +0000:

I want to use plone.app.multilingual on Plone 4.3.20. I installed PAM version 2.x from GitHub. PAM seems to work fine, but it prevents deleting the Plone site from the Zope instance. When I attempt to delete the Plone site with PAM in the buildout, I encounter the following issue:
...
Traceback (innermost last):
...
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 archetypes.multilingual.subscriber, line 113, in archetypes_creation_handler
Module plone.app.multilingual.subscriber, line 116, in set_recursive_language
Module plone.app.multilingual.manager, line 95, in update
AttributeError: 'NoneType' object has no attribute 'unrestrictedSearchResults'

This looks like a multilingual bug:
As you wrote, you try to delete a site but the
archetypes_creation_handler is activated and it apparently
expects to see a functional catalog but sees None instead
(the latter is likely the result of a previous event handler).
It is strange that a creation handler is called for a deletion.

Potentially, you can work around the bug by first
uninstalling multilingual in the site and only then delete this site.

Thank you for your response but this workaround does solve the issue. The error occurs already when PAM is in the buildout and not yet installed in the Plone site. Without archetypes.multilingual the issue is not there.