collective/Products.remember — pull request #7 by miohtama (2013-12-11 21:39:34+00:00)
Title: Password reset did not work with Hotfix 2013-12-10

If email as login portal option is turned on, the latest hotfix gave a traceback on mail password reset.

This is because it tries to give CatalogSearchArgumentsMap to catalog.search() function. Monkey-patched hotfix search function cannot handle this because it tries to call .copy() on CatalogSearchArgumentsMap (hotfix assumes normal request is passed).

According to the comments in hotfix the workaround seems to be using `catalog.searchResults()` instead of `catalog.search()`. From hotfix:

from DateTime import DateTime
from Products.CMFCore.permissions import AccessInactivePortalContent
from Products.CMFCore.utils import _checkPermission
from Products.CMFCore.utils import _getAuthenticatedUser
from Products.CMFPlone.CatalogTool import CatalogTool

orig_search = CatalogTool.search

def search(self, *args, **kw):
""" Wrap search() the same way that searchResults() is """
query = {}

if args:
query = args[0]

I performed manual test on this, as I did not get unit tests running (see another unrelated mail send issue regarding this).

I am not aware of security implications between search() and searchResults() as I found API unclear. I have no deep Zope magic knowledge so please shoot me down if I am wrong.