-
Notifications
You must be signed in to change notification settings - Fork 55
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
Calendar tile does not work under Plone 5 #633
Comments
@pbauer tried to fix it. But now in master we have the following error: 2022-02-03 10:36:55,349 ERROR [plone.subrequest:170][waitress-1] Error handling subrequest to http://localhost:8080/Plone/capa/@@collective.cover.calendar/e30ae925-a757-4f44-9ec5-e0bcd9360f4d
Traceback (most recent call last):
File "/home/user/.buildout/eggs/cp38/Chameleon-3.9.1-py3.8.egg/chameleon/template.py", line 192, in render
self._render(stream, econtext, rcontext)
File "/home/user/git/collective.cover/var/cache/8354dca6a444dcac52975b7d1ff4a4fe.py", line 639, in render
__iterator = _static_140219983632752('path', 'view/getEventsForCalendar', econtext=econtext)(_static_140219983631024(econtext, __zt_tmp))
File "/home/user/.buildout/eggs/cp38/zope.tales-5.1-py3.8.egg/zope/tales/expressions.py", line 250, in __call__
return self._eval(econtext)
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/PageTemplates/Expressions.py", line 225, in _eval
return render(ob, econtext.vars)
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/PageTemplates/Expressions.py", line 155, in render
ob = ob()
File "/home/user/git/collective.cover/src/collective/cover/tiles/calendar.py", line 76, in getEventsForCalendar
weeks = self.old_getEventsForCalendar(month, year, path=navigation_root_path)
File "/home/user/git/collective.cover/src/collective/cover/tiles/calendar.py", line 116, in old_getEventsForCalendar
calendar.setfirstweekday(first_weekday)
File "/usr/local/lib/python3.8/calendar.py", line 622, in setfirstweekday
raise IllegalWeekdayError(firstweekday)
calendar.IllegalWeekdayError: bad weekday number 7; must be 0 (Monday) to 6 (Sunday)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/.buildout/eggs/cp38/plone.subrequest-1.9.3-py3.8.egg/plone/subrequest/__init__.py", line 154, in subrequest
result = mapply(
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/ZPublisher/mapply.py", line 87, in mapply
return object(*args)
File "/home/user/.buildout/eggs/cp38/plone.tiles-2.3.1-py3.8.egg/plone/tiles/esi.py", line 87, in __call__
return self.index(*args, **kwargs)
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/Five/browser/pagetemplatefile.py", line 126, in __call__
return self.__func__(__self__, *args, **kw)
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/Five/browser/pagetemplatefile.py", line 58, in __call__
s = self.pt_render(
File "/home/user/.buildout/eggs/cp38/zope.pagetemplate-4.5.0-py3.8.egg/zope/pagetemplate/pagetemplate.py", line 133, in pt_render
return self._v_program(
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/PageTemplates/engine.py", line 378, in __call__
return template.render(**kwargs)
File "/home/user/.buildout/eggs/cp38/z3c.pt-3.3.0-py3.8.egg/z3c/pt/pagetemplate.py", line 176, in render
return base_renderer(**context)
File "/home/user/.buildout/eggs/cp38/Chameleon-3.9.1-py3.8.egg/chameleon/zpt/template.py", line 302, in render
return super(PageTemplate, self).render(**_kw)
File "/home/user/.buildout/eggs/cp38/Chameleon-3.9.1-py3.8.egg/chameleon/template.py", line 215, in render
raise_with_traceback(exc, tb)
File "/home/user/.buildout/eggs/cp38/Chameleon-3.9.1-py3.8.egg/chameleon/utils.py", line 53, in raise_with_traceback
raise exc
File "/home/user/.buildout/eggs/cp38/Chameleon-3.9.1-py3.8.egg/chameleon/template.py", line 192, in render
self._render(stream, econtext, rcontext)
File "/home/user/git/collective.cover/var/cache/8354dca6a444dcac52975b7d1ff4a4fe.py", line 639, in render
__iterator = _static_140219983632752('path', 'view/getEventsForCalendar', econtext=econtext)(_static_140219983631024(econtext, __zt_tmp))
File "/home/user/.buildout/eggs/cp38/zope.tales-5.1-py3.8.egg/zope/tales/expressions.py", line 250, in __call__
return self._eval(econtext)
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/PageTemplates/Expressions.py", line 225, in _eval
return render(ob, econtext.vars)
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/PageTemplates/Expressions.py", line 155, in render
ob = ob()
File "/home/user/git/collective.cover/src/collective/cover/tiles/calendar.py", line 76, in getEventsForCalendar
weeks = self.old_getEventsForCalendar(month, year, path=navigation_root_path)
File "/home/user/git/collective.cover/src/collective/cover/tiles/calendar.py", line 116, in old_getEventsForCalendar
calendar.setfirstweekday(first_weekday)
File "/usr/local/lib/python3.8/calendar.py", line 622, in setfirstweekday
raise IllegalWeekdayError(firstweekday)
calendar.IllegalWeekdayError: calendar.IllegalWeekdayError: bad weekday number 7; must be 0 (Monday) to 6 (Sunday)
- Expression: "view/getEventsForCalendar"
- Filename: ... e.cover/src/collective/cover/tiles/templates/calendar.pt
- Location: (line 59: col 33)
- Source: <tr tal:repeat="week view/getEventsForCalendar">
^^^^^^^^^^^^^^^^^^^^^^^^^
- Arguments: template: <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7f877df1ea00>
options: {}
args: ()
nothing: None
modules: <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter object at 0x7f87862bb6a0>
request: <WSGIRequest, URL=http://localhost:8080/Plone/capa/@@collective.cover.calendar/e30ae925-a757-4f44-9ec5-e0bcd9360f4d>
view: <Products.Five.browser.metaconfigure.CalendarTile object at 0x7f876e191e80>
context: <Cover at /Plone/capa>
views: <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7f876dec3af0>
here: <Cover at /Plone/capa>
container: <Cover at /Plone/capa>
root: <Application at >
traverse_subpath: []
user: <PropertiedUser 'admin'>
default: <DEFAULT>
repeat: <Products.PageTemplates.engine.RepeatDictWrapper object at 0x7f877e48eb40>
loop: {'weekday': <Products.PageTemplates.engine.RepeatItem object at 0x7f876dec3d00>}
target_language: None
translate: <function BaseTemplate.render.<locals>.translate at 0x7f876dddcaf0>
attrs: {}
navigation_root_url: 'http://localhost:8080/Plone'
query_string: ''
url_quote_plus: <function quote_plus at 0x7f878f9c7700>
showPrevMonth: True
showNextMonth: True
year: 2022
2022-02-03 10:36:55,350 ERROR [plone.app.blocks:72][waitress-1] There was an error while resolving the tile: http://localhost:8080/Plone/capa/@@collective.cover.calendar/e30ae925-a757-4f44-9ec5-e0bcd9360f4d
Traceback (most recent call last):
File "/home/user/.buildout/eggs/cp38/Chameleon-3.9.1-py3.8.egg/chameleon/template.py", line 192, in render
self._render(stream, econtext, rcontext)
File "/home/user/git/collective.cover/var/cache/8354dca6a444dcac52975b7d1ff4a4fe.py", line 639, in render
__iterator = _static_140219983632752('path', 'view/getEventsForCalendar', econtext=econtext)(_static_140219983631024(econtext, __zt_tmp))
File "/home/user/.buildout/eggs/cp38/zope.tales-5.1-py3.8.egg/zope/tales/expressions.py", line 250, in __call__
return self._eval(econtext)
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/PageTemplates/Expressions.py", line 225, in _eval
return render(ob, econtext.vars)
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/PageTemplates/Expressions.py", line 155, in render
ob = ob()
File "/home/user/git/collective.cover/src/collective/cover/tiles/calendar.py", line 76, in getEventsForCalendar
weeks = self.old_getEventsForCalendar(month, year, path=navigation_root_path)
File "/home/user/git/collective.cover/src/collective/cover/tiles/calendar.py", line 116, in old_getEventsForCalendar
calendar.setfirstweekday(first_weekday)
File "/usr/local/lib/python3.8/calendar.py", line 622, in setfirstweekday
raise IllegalWeekdayError(firstweekday)
calendar.IllegalWeekdayError: bad weekday number 7; must be 0 (Monday) to 6 (Sunday)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/.buildout/eggs/cp38/plone.subrequest-1.9.3-py3.8.egg/plone/subrequest/__init__.py", line 154, in subrequest
result = mapply(
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/ZPublisher/mapply.py", line 87, in mapply
return object(*args)
File "/home/user/.buildout/eggs/cp38/plone.tiles-2.3.1-py3.8.egg/plone/tiles/esi.py", line 87, in __call__
return self.index(*args, **kwargs)
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/Five/browser/pagetemplatefile.py", line 126, in __call__
return self.__func__(__self__, *args, **kw)
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/Five/browser/pagetemplatefile.py", line 58, in __call__
s = self.pt_render(
File "/home/user/.buildout/eggs/cp38/zope.pagetemplate-4.5.0-py3.8.egg/zope/pagetemplate/pagetemplate.py", line 133, in pt_render
return self._v_program(
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/PageTemplates/engine.py", line 378, in __call__
return template.render(**kwargs)
File "/home/user/.buildout/eggs/cp38/z3c.pt-3.3.0-py3.8.egg/z3c/pt/pagetemplate.py", line 176, in render
return base_renderer(**context)
File "/home/user/.buildout/eggs/cp38/Chameleon-3.9.1-py3.8.egg/chameleon/zpt/template.py", line 302, in render
return super(PageTemplate, self).render(**_kw)
File "/home/user/.buildout/eggs/cp38/Chameleon-3.9.1-py3.8.egg/chameleon/template.py", line 215, in render
raise_with_traceback(exc, tb)
File "/home/user/.buildout/eggs/cp38/Chameleon-3.9.1-py3.8.egg/chameleon/utils.py", line 53, in raise_with_traceback
raise exc
File "/home/user/.buildout/eggs/cp38/Chameleon-3.9.1-py3.8.egg/chameleon/template.py", line 192, in render
self._render(stream, econtext, rcontext)
File "/home/user/git/collective.cover/var/cache/8354dca6a444dcac52975b7d1ff4a4fe.py", line 639, in render
__iterator = _static_140219983632752('path', 'view/getEventsForCalendar', econtext=econtext)(_static_140219983631024(econtext, __zt_tmp))
File "/home/user/.buildout/eggs/cp38/zope.tales-5.1-py3.8.egg/zope/tales/expressions.py", line 250, in __call__
return self._eval(econtext)
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/PageTemplates/Expressions.py", line 225, in _eval
return render(ob, econtext.vars)
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/Products/PageTemplates/Expressions.py", line 155, in render
ob = ob()
File "/home/user/git/collective.cover/src/collective/cover/tiles/calendar.py", line 76, in getEventsForCalendar
weeks = self.old_getEventsForCalendar(month, year, path=navigation_root_path)
File "/home/user/git/collective.cover/src/collective/cover/tiles/calendar.py", line 116, in old_getEventsForCalendar
calendar.setfirstweekday(first_weekday)
File "/usr/local/lib/python3.8/calendar.py", line 622, in setfirstweekday
raise IllegalWeekdayError(firstweekday)
calendar.IllegalWeekdayError: calendar.IllegalWeekdayError: bad weekday number 7; must be 0 (Monday) to 6 (Sunday)
- Expression: "view/getEventsForCalendar"
- Filename: ... e.cover/src/collective/cover/tiles/templates/calendar.pt
- Location: (line 59: col 33)
- Source: <tr tal:repeat="week view/getEventsForCalendar">
^^^^^^^^^^^^^^^^^^^^^^^^^
- Arguments: template: <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7f877df1ea00>
options: {}
args: ()
nothing: None
modules: <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter object at 0x7f87862bb6a0>
request: <WSGIRequest, URL=None>
view: <Products.Five.browser.metaconfigure.CalendarTile object at 0x7f876e191e80>
context: <Cover at /Plone/capa>
views: <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7f876dec3af0>
here: <Cover at /Plone/capa>
container: <Cover at /Plone/capa>
root: <Application at >
traverse_subpath: []
user: <PropertiedUser 'admin'>
default: <DEFAULT>
repeat: <Products.PageTemplates.engine.RepeatDictWrapper object at 0x7f877e48eb40>
loop: {'weekday': <Products.PageTemplates.engine.RepeatItem object at 0x7f876dec3d00>}
target_language: None
translate: <function BaseTemplate.render.<locals>.translate at 0x7f876dddcaf0>
attrs: {}
navigation_root_url: 'http://localhost:8080/Plone'
query_string: ''
url_quote_plus: <function quote_plus at 0x7f878f9c7700>
showPrevMonth: True
showNextMonth: True
year: 2022
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/.buildout/eggs/cp38/plone.app.blocks-5.0.0-py3.8.egg/plone/app/blocks/utils.py", line 70, in resolve
resolved = resolveResource(url)
File "/home/user/.buildout/eggs/cp38/plone.app.blocks-5.0.0-py3.8.egg/plone/app/blocks/utils.py", line 136, in resolveResource
response = subrequest(url, exception_handler=subresponse_exception_handler)
File "/home/user/.buildout/eggs/cp38/plone.subrequest-1.9.3-py3.8.egg/plone/subrequest/__init__.py", line 172, in subrequest
exception_handler(response, e)
File "/home/user/.buildout/eggs/cp38/plone.app.blocks-5.0.0-py3.8.egg/plone/app/blocks/utils.py", line 109, in subresponse_exception_handler
return response.exception()
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/ZPublisher/HTTPResponse.py", line 953, in exception
b + self._traceback(t, '(see above)', tb, 0)),
File "/home/user/.buildout/eggs/cp38/Zope-4.6.3-py3.8.egg/ZPublisher/HTTPResponse.py", line 807, in _traceback
tb = format_exception(t, v, tb, as_html=as_html)
File "/home/user/.buildout/eggs/cp38/zExceptions-4.1-py3.8.egg/zExceptions/ExceptionFormatter.py", line 251, in format_exception
return fmt.formatException(t, v, tb, limit=limit)
File "/home/user/.buildout/eggs/cp38/zExceptions-4.1-py3.8.egg/zExceptions/ExceptionFormatter.py", line 198, in formatException
exc_line = self.formatExceptionOnly(etype, value)
File "/home/user/.buildout/eggs/cp38/zExceptions-4.1-py3.8.egg/zExceptions/ExceptionFormatter.py", line 177, in formatExceptionOnly
traceback.format_exception_only(etype, value))
File "/usr/local/lib/python3.8/traceback.py", line 140, in format_exception_only
return list(TracebackException(etype, value, None).format_exception_only())
File "/usr/local/lib/python3.8/traceback.py", line 479, in __init__
if (exc_value and exc_value.__cause__ is not None
AttributeError: 'str' object has no attribute '__cause__' |
The calendar tile worked in my tests but I'll try to reproduce and fix the issue tomorrow. |
@pbauer the problem is that
is getting the value 7. But the calendar library only accepts 0 to 6. Why are you using the registry there? It couldn't be done like is done in CalendarTool: |
uh even in CalendarTool this was configurable. |
@pbauer Maybe that's why it worked for you and not me. |
@pbauer see that CalendarTool doesn't add +1 to like you did in:
The calendar probably looks weird to you, but you should change the |
The code of the calendar tile was copied from the calendar portlet and it depends on the
portal_calendar
tool; this tools was removed in Plone 5:https://travis-ci.org/collective/collective.cover/jobs/141693521#L1392
We need to refactor this part of the code to allow compatibility.
Some ideas can be taken from #600.
The text was updated successfully, but these errors were encountered: