View Issue Details

This issue affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
18831Feature requestsPluginspublic2026-09-29 21:03
Reporteruser364749Assigned To 
PrioritynoneSeverityfeature 
Status newResolutionopen 
Summary18831: AuditLog plugin does not log survey delete events
Description

I think this is quite an important a event that we should be logging.

There may also be other important events that we could be logging but we are not.

Additional Information

Cloud customer reported survey disappeared and requested audit-log but the log data does not contain any useful information.

TagsNo tags attached.
Bug heat4
Users affected %0

Users monitoring this issue

rafaelmaia

Activities

rafaelmaia

rafaelmaia

2026-09-29 21:03

reporter   ~86095

I would like to contribute this feature and have a pull request ready for review. Approach:

  • The AuditLog plugin subscribes to the existing beforeSurveyDelete model event. Core already fires it from Survey::delete() after the permission check and before any related data is removed. No core file changes.
  • This covers every normal way to delete a survey: admin single delete, admin bulk delete, RemoteControl delete_survey, and the cleanup after a failed survey import.
  • One row is logged with entity survey, entityid = survey ID, action delete, and uid = the user who deleted it. oldvalues holds the survey attributes plus the survey title in every language, so the survey can still be identified after it is gone. The bounce account password (bounceaccountpass) is left out, the same way the user password is left out when a user is deleted.
  • New global plugin setting "Survey deleted", on by default. The "Survey settings" heading in the plugin settings is renamed to "Surveys" so both survey entries sit under it.
  • The per-survey "Audit log for this survey" setting is deliberately NOT checked for this event. That setting is about person-related data. If it could suppress this entry, a survey owner could switch auditing off and then delete the survey without a trace, which is the situation this ticket describes.
  • Not covered: the data consistency check removes orphaned surveys with deleteByPk(), which fires no model events.
  • Possible follow-ups, not in this change: other events that are not logged yet, e.g. survey activation/deactivation and question/group deletion.

Target branch: develop-minor. Unit tests are included (tests/unit/plugins/AuditLogTest.php).
Feedback on the approach is welcome, especially on skipping the per-survey setting.

Issue History

Date Modified Username Field Change
2023-05-19 10:56 user364749 New Issue
2026-09-29 21:02 rafaelmaia Issue Monitored: rafaelmaia
2026-09-29 21:02 rafaelmaia Bug heat 0 => 2
2026-09-29 21:03 rafaelmaia Note Added: 86095
2026-09-29 21:03 rafaelmaia Bug heat 2 => 4