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

Wrong recurrence string made in Volto #4498

Closed
cekk opened this issue Mar 10, 2023 · 7 comments · Fixed by #4604
Closed

Wrong recurrence string made in Volto #4498

cekk opened this issue Mar 10, 2023 · 7 comments · Fixed by #4604

Comments

@cekk
Copy link
Member

cekk commented Mar 10, 2023

Describe the bug

It seems that the rrule string generated in Volto isn't correct.

To Reproduce
Steps to reproduce the behavior:

How to reproduce it:

  • Add an Event
  • Set start and end date (end some years in the future)
  • Select recurrence: yearly, every 1 year, repeat the same day and stop after 3 recurrences
  • Save

Expected behavior

Event can be saved with the selected recurrence, but Plone returns an error because the string is not well formatted.
The same setting in Classic Plone Works.

Volto send a string like this:

RRULE:INTERVAL=1;COUNT=3;BYMONTHDAY=10;BYMONTH=3"

Same settings in Plone:

RRULE:FREQ=YEARLY;BYMONTH=3;BYMONTHDAY=10;COUNT=3

This is the traceback:

Traceback (innermost last):
Module ZPublisher.WSGIPublisher, line 167, in transaction_pubevents
Module ZPublisher.WSGIPublisher, line 376, in publish_module
Module ZPublisher.WSGIPublisher, line 271, in publish
Module ZPublisher.mapply, line 85, in mapply
Module ZPublisher.WSGIPublisher, line 63, in call_object
Module plone.rest.service, line 22, in call
Module plone.restapi.services, line 19, in render
Module plone.restapi.services.content.add, line 93, in reply
Module plone.restapi.services.content.utils, line 95, in add
Module OFS.ObjectManager, line 383, in _setObject
Module zope.event, line 32, in notify
Module zope.component.event, line 27, in dispatch
Module zope.component._api, line 134, in subscribers
Module zope.interface.registry, line 448, in subscribers
Module zope.interface.adapter, line 899, in subscribers
Module zope.component.event, line 36, in objectEventNotify
Module zope.component._api, line 134, in subscribers
Module zope.interface.registry, line 448, in subscribers
Module zope.interface.adapter, line 899, in subscribers
Module Products.CMFCore.CMFCatalogAware, line 274, in handleContentishEvent
Module Products.CMFCore.CMFCatalogAware, line 197, in notifyWorkflowCreated
Module Products.CMFCore.WorkflowTool, line 300, in notifyCreated
Module Products.CMFCore.WorkflowTool, line 610, in _reindexWorkflowVariables
Module Products.CMFCore.CMFCatalogAware, line 110, in reindexObjectSecurity
Module Products.CMFCore.CatalogTool, line 272, in unrestrictedSearchResults
Module Products.CMFCore.indexing, line 97, in processQueue
Module Products.CMFCore.indexing, line 227, in process
Module Products.CMFCore.indexing, line 49, in reindex
Module Products.CMFCore.CatalogTool, line 368, in _reindexObject
Module Products.CMFPlone.CatalogTool, line 361, in catalog_object
Module Products.ZCatalog.ZCatalog, line 507, in catalog_object
Module Products.ZCatalog.Catalog, line 341, in catalogObject
Module Products.ZCatalog.Catalog, line 292, in updateMetadata
Module Products.ZCatalog.Catalog, line 425, in recordify
Module plone.indexer.wrapper, line 65, in getattr
Module plone.indexer.delegate, line 20, in call
Module plone.app.event.dx.behaviors, line 348, in end_indexer
Module plone.app.event.dx.behaviors, line 503, in end
Module plone.app.event.dx.behaviors, line 479, in _recurrence_upcoming_event
Module plone.app.event.recurrence, line 100, in occurrences
Module plone.event.recurrence, line 110, in recurrence_sequence_ical
Module dateutil.rrule, line 1732, in call
Module dateutil.rrule, line 1707, in _parse_rfc
Module dateutil.rrule, line 1561, in _parse_rfc_rrule
TypeError: init() missing 1 required positional argument: 'freq'

The difference seems to be in missing FREQ, but i'm not a dates expert.

Software (please complete the following information):

Tested also on https://demo.plone.org

@Narottamchy
Copy link

Narottamchy commented Mar 12, 2023

hey can you elaborate this more. I want to work on this bug.

@tiberiuichim
Copy link
Contributor

@Narottamchy

The idea is that the recurence definition is processed by 2 libraries: the rrule npm package (used in Volto via the RecurenceWidget) and the dateutil.rrule in the Plone Python backend.

The problem is that some recurrence value was generated that's missing the freq value, which is required when this data is sent in the backend.

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Mar 22, 2023

Hello @cekk , I followed same steps and it seems to be working fine to me
On localhost -
image

On demo -
image

@cekk
Copy link
Member Author

cekk commented Mar 22, 2023

The error is fired on save..can you save that event?

@BhuvaneshPatil
Copy link
Contributor

Sorry @cekk . My bad. I got this error. I thought with save you meant saving in the dialog of recurrence. When I saved the whole event from left side bar, it gave me error.

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Mar 22, 2023

Hello, I was able to refactor and resolve the issue. I'll raise the PR once my contributor agreement is approved

@cekk
Copy link
Member Author

cekk commented May 22, 2023

@BhuvaneshPatil any news about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants