Skip to content

Commit

Permalink
Merge pull request #60 from plone/datakure-type-error
Browse files Browse the repository at this point in the history
Fix issue where tile rendering failed with failing view lookup
  • Loading branch information
datakurre committed Jan 15, 2017
2 parents 0a1bea8 + ee2e102 commit ca70e9b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion plone/app/standardtiles/portlets/utils.py
Expand Up @@ -2,6 +2,9 @@
from zope.browser.interfaces import IView
from zope.component import queryMultiAdapter

import logging
logger = logging.getLogger('plone.app.standardtiles')


def findView(tile, viewName):
"""Find the view to use for portlet/viewlet context lookup."""
Expand All @@ -21,7 +24,14 @@ def findView(tile, viewName):
request = prequest

if viewName is not None:
view = queryMultiAdapter((tile.context, request), name=viewName)
try:
view = queryMultiAdapter((tile.context, request), name=viewName)
except TypeError:
# Helps to debug an issue where broken view registration raised:
# TypeError: __init__() takes exactly N arguments (3 given)
logger.exception('Error in resolving view for tile: {0:s}'.format(
tile.url))
view = None

if view is None:
view = tile
Expand Down

0 comments on commit ca70e9b

Please sign in to comment.