Add a hook to alter instances to be deleted when updating a series

Created on 6 September 2023, about 1 year ago
Updated 28 September 2023, about 1 year ago

Problem/Motivation

As far as I can tell, there isn't currently an easy way to stop an instance from being deleted when its series is updated. This may not be ideal if an instance contains information that otherwise needs to be kept around. We should provide a hook to allow altering the instances before they are deleted and recreated.

✨ Feature request
Status

Fixed

Version

2.0

Component

Recurring Events (Main module)

Created by

πŸ‡ΊπŸ‡ΈUnited States mrweiner

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

Comments & Activities

  • Issue created by @mrweiner
  • πŸ‡ΊπŸ‡ΈUnited States mrweiner

    Here's a patch that I created for my own use. The message I added in the event that instances were skipped probably isn't ideal for all cases. It might be nice to provide some way for the user to modify the message/provide their own message. Maybe another alter hook specifically for the message?

    Patch doesn't provide tests.

  • Status changed to Needs review about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States mrweiner

    Probably worth marking NR for visibility.

  • πŸ‡ΊπŸ‡ΈUnited States owenbush Denver, CO

    This is an interesting idea and I think the idea of adding a hook is a good one for this use-case. I do have some questions, though. In order to trigger the instance deletions, you must be updating something related to the recurrence pattern (either the type, the date, the time, the duration etc). The skipped events then will not match that pattern as they won't have been recreated. So how are you handling that sort of thing? Manually updating those events? Or is it not a problem that some of the event instances may be out of sync with the series configuration?

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

    Or is it not a problem that some of the event instances may be out of sync with the series configuration?

    Exactly this. The eventseries represents a music lesson schedule, and the instances represent music lessons. Teachers attach things like lesson notes, teaching materials media to share with students, etc, onto the instances, so I need this information to persist regardless of the overall schedule change. The initial date is also valuable in itself.

    I'm sure there are a variety of use cases where folks might need a particular instance to stick around even if it's out of sync with the series.

  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States owenbush Denver, CO

    Thanks for the patch and explanations. This has been merged into the latest dev branches.

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

    Rad, thanks!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024