Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix count/decode error in boolean widget #190

Merged
merged 5 commits into from
Dec 16, 2019

Conversation

mauritsvanrees
Copy link
Contributor

This fixes issue #111 and #118.
Problem seen on Plone 5.1 and 5.2 with current master:

    Traceback (innermost last):
      Module ZPublisher.WSGIPublisher, line 155, in transaction_pubevents
      Module ZPublisher.WSGIPublisher, line 337, in publish_module
      Module ZPublisher.WSGIPublisher, line 255, in publish
      Module ZPublisher.mapply, line 85, in mapply
      Module ZPublisher.WSGIPublisher, line 61, in call_object
      Module eea.facetednavigation.caching.nocache, line 12, in replacement
      Module eea.facetednavigation.browser.app.counter, line 77, in __call__
      Module eea.facetednavigation.browser.app.counter, line 58, in query
      Module eea.facetednavigation.widgets.widget, line 390, in count
    AttributeError: 'int' object has no attribute 'decode'

Note that the boolean widget always has a vocabulary of [(1,1)], and that is the int object that causes the traceback.

I can't get my head around whether this PR works well for all combinations of "boolean widget plus any index" and "any widget plus boolean index". And I can't get any checkbox widget to appear, with or without this fix. But it works for a boolean widget with a boolean or integer index.

mauritsvanrees and others added 3 commits December 11, 2019 14:23
Otherwise you get a traceback when getting the faceted_counter:

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 155, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 337, in publish_module
  Module ZPublisher.WSGIPublisher, line 255, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 61, in call_object
  Module eea.facetednavigation.caching.nocache, line 12, in replacement
  Module eea.facetednavigation.browser.app.counter, line 77, in __call__
  Module eea.facetednavigation.browser.app.counter, line 58, in query
  Module eea.facetednavigation.widgets.widget, line 390, in count
AttributeError: 'int' object has no attribute 'decode'
@avoinea avoinea changed the base branch from master to develop December 11, 2019 16:52
@avoinea avoinea merged commit c996927 into eea:develop Dec 16, 2019
@mauritsvanrees mauritsvanrees deleted the maurits/fix-count-decode-error branch December 16, 2019 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants