View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 19951 | Bug reports | Plugins | public | 2025-01-31 18:20 | 2026-11-01 00:06 |
| Reporter | francois-charles.hebert | Assigned To | c_schmitz | ||
| Priority | none | Severity | block | ||
| Status | resolved | Resolution | fixed | ||
| Product Version | 6.6.x | ||||
| Summary | 19951: Some events are not triggered | ||||
| Description | I'm trying to log question group delete actions in a table, but some events are not triggered upon deletion. Events that i tried:
beforeModelDeleteMany is triggered multiple times when deleting a question group: 2025/01/31 16:09:06 [trace] [plugin.Trigger Plugins Events] beforeModelDeleteMany: {"model":"QuestionGroupL10n","filterCriteria":{"select":"*","distinct":false,"condition":" 2025/01/31 16:09:06 [trace] [plugin.Trigger Plugins Events] beforeModelDeleteMany: {"model":"QuestionGroup","filterCriteria":{"select":"*","distinct":false,"condition":" When i query the questions table using the sid and gid params contained in the filterCriteria, the result is always false. I think at this point the question are already deleted, but the afterQuestionDelete event is not raised. | ||||
| Steps To Reproduce | Steps to reproduce
Expected resultThe log should contains message that indicates that the events were triggered. Actual resultI think the following events should be triggered upon QuestionGroup deletion:
I think the questions should be deleted after the resolution of beforeModelDeleteMany, so we can fetch all the related data. Or maybe it should triggers the beforeModelDelete and afterModelDelete for related models. For example, in the case of QuestionGroup delete, the beforeQuestionDelete and AfterQuestionDelete should be triggered. Same for QuestionL10n... | ||||
| Tags | No tags attached. | ||||
| Attached Files | |||||
| Bug heat | 8 | ||||
| Complete LimeSurvey version number (& build) | 6.10.1 build 255 | ||||
| I will donate to the project if issue is resolved | No | ||||
| Browser | |||||
| Database type & version | mysql | ||||
| Server OS (if known) | |||||
| Webserver software & version (if known) | |||||
| PHP Version | 8.3.1 | ||||
| Git branch / Pull Request URL | |||||
|
@gabrieljenik : we don't have an existing Pull Request for such issue ? |
|
|
I don't think so... at least not recent... |
|
|
Also the beforeQuestionSave is triggered like 10 times when creating a question (Long free text (Type: T)) for some reasons. |
|
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=41207 |
|
|
LimeSurvey: master bf87b9a4 2026-11-01 00:05 Details Diff |
Fixed issue 19951: Plugins were not notified when a question group was deleted, and could not see which questions were deleted with it Dev QuestionGroup::deleteWithDependency() now deletes the group via delete() before its questions, so beforeQuestionGroupDelete/afterQuestionGroupDelete and beforeModelDelete/afterModelDelete are raised while the questions still exist |
Affected Issues 19951 |
|
| mod - application/models/QuestionGroup.php | Diff File | ||
| add - tests/data/plugins/QuestionGroupDeleteEventsPlugin.php | Diff File | ||
| add - tests/unit/models/QuestionGroupDeleteEventsTest.php | Diff File | ||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2025-01-31 18:20 | francois-charles.hebert | New Issue | |
| 2025-01-31 18:20 | francois-charles.hebert | File Added: TriggerPluginsEvents.zip | |
| 2025-01-31 19:13 | DenisChenu | Category | Plugins => Usability/user experience |
| 2025-01-31 19:13 | DenisChenu | Additional Information Updated | |
| 2025-01-31 19:14 | DenisChenu | Category | Usability/user experience => Plugins |
| 2025-01-31 19:14 | DenisChenu | Additional Information Updated | |
| 2025-02-03 11:19 | tibor.pacalat | Assigned To | => DenisChenu |
| 2025-02-03 11:19 | tibor.pacalat | Status | new => assigned |
| 2025-02-03 11:27 | DenisChenu | Note Added: 81939 | |
| 2025-02-03 11:27 | DenisChenu | Bug heat | 0 => 2 |
| 2025-02-03 13:34 | gabrieljenik | Note Added: 81945 | |
| 2025-02-03 13:34 | gabrieljenik | Bug heat | 2 => 4 |
| 2025-02-04 20:54 | francois-charles.hebert | Note Added: 81969 | |
| 2025-02-04 20:54 | francois-charles.hebert | File Added: image.png | |
| 2025-02-04 20:54 | francois-charles.hebert | Bug heat | 4 => 6 |
| 2026-11-01 00:06 | c_schmitz | Changeset attached | => LimeSurvey master bf87b9a4 |
| 2026-11-01 00:06 | c_schmitz | Note Added: 87059 | |
| 2026-11-01 00:06 | c_schmitz | Assigned To | DenisChenu => c_schmitz |
| 2026-11-01 00:06 | c_schmitz | Status | assigned => resolved |
| 2026-11-01 00:06 | c_schmitz | Resolution | open => fixed |
| 2026-11-01 00:06 | c_schmitz | Bug heat | 6 => 8 |