collective / Products.PloneKeywordManager

Change, merge and delete keywords (AKA tags or subjects) in Plone.
https://pypi.org/project/Products.PloneKeywordManager/
4 stars 8 forks source link

NoneType value in index breaks the control panel #28

Closed mauritsvanrees closed 5 years ago

mauritsvanrees commented 5 years ago

Seen on Plone 4.3 with Products.PloneKeywordManager 2.2.1 (and branch 2.2.x), but probably true for Plone 5 and master branch as well. The control panel allows me to choose between three indexes. Two of them go fine. One of them has None in the indexed values, and this breaks the sorting:

  Module Products.PloneKeywordManager.tool, line 181, in getKeywords
  Module Products.PloneKeywordManager.tool, line 181, in <lambda>
AttributeError: 'NoneType' object has no attribute 'lower'

This is from the commentators index from plone.app.discussion, but can probably happen for others as well.

Easiest seems to be to filter out all empty values (including empty string) before sorting. I will make a PR for that on 2.2.x.

mauritsvanrees commented 5 years ago

I have merged my PRs. New releases of 2.2.x and master would be useful. cc @jensens @saily @tdesvenain @jessesnyder

jensens commented 5 years ago

Done: https://pypi.org/manage/project/Products.PloneKeywordManager/release/3.0.1/ I also gave the user collective Maintainer access there.

mauritsvanrees commented 5 years ago

Thanks. I have released 2.2.2.

jensens commented 5 years ago

I have released 2.2.2.

ops, forgot about this one. thanks!