View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
19821Bug reportsPluginspublic2024-11-08 09:42
Reporterbismark Assigned Totibor.pacalat  
PrioritynoneSeverityminor 
Status in code reviewResolutionopen 
Product Version6.6.x 
Summary19821: Answer should be deleted by delete() method
Description

we need to trigger afterModelDelete for answers and subquestions.
In the case of answers Question->deleteAllAnswers() is responsible for deleting answers.
deleting Answers by Answer::model()->deleteAll($criteria) does not trigger afterModelDelete

use $answer->delete() instead

Code in application/models/Question.php #527

Steps To Reproduce

Steps to reproduce

(Replace this text with detailed step-by-step instructions on how to reproduce the issue)

Expected result

(Write here what you expected to happen)

Actual result

(Write here what happened instead)

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)6.6.6
I will donate to the project if issue is resolvedNo
Browser
Database type & versionmysql
Server OS (if known)
Webserver software & version (if known)
PHP Version8.0

Relationships

related to 19822 in code reviewtibor.pacalat Subquestions should be deleted by delete() method 

Users monitoring this issue

There are no users monitoring this issue.

Activities

bismark

bismark

2024-11-03 10:47

reporter   ~81331

https://github.com/LimeSurvey/LimeSurvey/pull/4012

Mazi

Mazi

2024-11-08 09:12

updater   ~81356

@tibor.pacalat, this is very similar to 19822, can someone review the fix as well please?

DenisChenu

DenisChenu

2024-11-08 09:41

developer   ~81357

https://github.com/LimeSurvey/LimeSurvey/pull/4012#discussion_r1828030835

Issue History

Date Modified Username Field Change
2024-11-01 15:53 bismark New Issue
2024-11-02 09:54 DenisChenu Category Question editor => Plugins
2024-11-03 10:47 bismark Note Added: 81331
2024-11-03 10:47 bismark Bug heat 0 => 2
2024-11-03 11:13 bismark Issue cloned: 19822
2024-11-08 09:11 Mazi Relationship added related to 19822
2024-11-08 09:11 Mazi Assigned To => tibor.pacalat
2024-11-08 09:11 Mazi Status new => assigned
2024-11-08 09:12 Mazi Note Added: 81356
2024-11-08 09:12 Mazi Bug heat 2 => 4
2024-11-08 09:41 DenisChenu Note Added: 81357
2024-11-08 09:41 DenisChenu Bug heat 4 => 6
2024-11-08 09:42 DenisChenu Status assigned => in code review