matomo icon indicating copy to clipboard operation
matomo copied to clipboard

[Bug] Updating scheduled email report fails if goal has been deleted

Open pgampe opened this issue 10 months ago • 0 comments

Steps to reproduce (all in UI):

  • Create a goal
  • Create a scheduled report using this goal
  • Create a new goal
  • Delete the old goal
  • Open scheduled report
  • Select new goal
  • Try to save scheduled report

Overserved:

Saving fails with an exception.

Expected

Successful save

This fails due to:

https://github.com/matomo-org/matomo/blob/d0b89d2cf0e58648aa72f4e4214328c10e959fd6/plugins/ScheduledReports/API.php#L826

Suggested solution:

Instead of throwing an exception, unset the respective report from the array.

I tried this locally and it works fine.

pgampe avatar Apr 17 '24 08:04 pgampe