Date exclude save wiping out dates and exclusions when saving

Created on 25 February 2020, over 4 years ago
Updated 24 April 2024, 7 months ago

Hello!

Recently implemented the date exclusion widget via the Sierra version of the widget and it was great! Today I found that when I saved the node after excluding dates it wiped out the exclusion dates.

We are not calling any hooks and have a very uncomplicated node.

πŸ› Bug report
Status

Fixed

Version

3.1

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada cjboranp

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΊAustralia dpi Perth, Australia

    Looked into this issue a bit more.

    This scenario looks like its only possible when the rules given DO NOT match the 'custom' recurrence option in guessRecurrenceOptionFromRrule, such as when you have a clean rrule like FREQ=DAILY, with EXDATES, and the occurrence model is NOT interacted with.

    Right now, whenever you interact with the occurrence model at all, when you close the modal with the 'Done' button (not the X quit button), the recurrence option is always set to 'custom' in transferModalToFormStateCallback:

          $input = &$form_state->getUserInput();
          // After closing modal, switch dropdown to custom setting.
          $input[$fieldName][$delta]['recurrence_option'] = 'custom';
    

    I think what needs to happen here is the guesser needs to match the transferModel behaviour by setting to custom if there are any exdates.

    ----

    On the DateRecurModularSierraWidget::validateModularWidget changes introduced by 10, I wasnt particularly happy with these changes. They look quite brittle, tied to a particular RRULE style. So this has been discarded.

    ----

    The change proposed by #5 does not look relevant to this issue, as I was able to reproduce and fix the primary issue reported by this issue without the proposed modification. This change has been discarded. Please create a new issue if you find your bug persists.

  • πŸ‡¦πŸ‡ΊAustralia dpi Perth, Australia
  • Issue was unassigned.
  • Status changed to Fixed almost 2 years ago
  • πŸ‡¦πŸ‡ΊAustralia dpi Perth, Australia
  • πŸ‡¦πŸ‡ΊAustralia dpi Perth, Australia

    Committed with modifications, please test, thanks.

  • πŸ‡¦πŸ‡ΊAustralia dpi Perth, Australia
  • πŸ‡¦πŸ‡ΊAustralia dpi Perth, Australia
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States Ki

    If you use PHP 7.x and get the PHP error, "TypeError: explode() expects parameter 2 to be string, bool given in explode()", apply this patch.

  • πŸ‡ΊπŸ‡ΈUnited States Ki

    This patch works with version 3.1.0

  • πŸ‡ΊπŸ‡ΈUnited States seanr

    I had to manually massage the patch in 21 to get it to work - it needs a re-roll (still against 3.1.0), but it also needs a trailing line break. I've attached my locally modified patch which should apply, but it really needs a proper re-roll (at least until we get a new release).

Production build 0.71.5 2024