View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
14952Bug reportsOtherpublic2021-03-22 15:27
ReporterDenisChenu Assigned Toc_schmitz  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version4.0.0-beta 
Summary14952: Checkintegrity didn't delete question_l10ns and other
Description

When a question is deleted via checkintegrity : related question language are not deleted

Steps To Reproduce

Import included survey
get the 1st qid , filter in DB question_l10ns for this qid (phpMyAdmin for example)
Launch checkintegrity : 3 times if i remind
reload DB (phpMyAdmin for example)
question_l10ns qid is still there

Additional Information

Same for group, answers and maybe some other. Only defaultvalues is deleted currently

TODO must check fixLanguageConsistency function if there are issue like this one

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)4.0.0 github 1c4b7e853cbd3956c9aea525922df2a90e7019b2
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionnot relevant ?
Server OS (if known)not relevant ?
Webserver software & version (if known)not relevant ?
PHP Versionnot relevant ?

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2019-05-29 14:02

developer   ~52153

Last edited: 2019-05-29 14:02

@dominikvitt : i think i move whole to

DefaultValue::model()->with('question')->deleteAll('question.qid IS NULL');
DefaultValueL10n::model()->with('defaultvalue')->deleteAll('defaultvalue.dvid IS NULL');

Are there any reason to do find + foreach ?

dominikvitt

dominikvitt

2019-05-29 15:04

developer   ~52160

Last edited: 2021-03-22 14:59

No, it won't work.
First line would delete all default values where qid is missing, which is correct.
But, second line would leave orphaned DefaultValueL10n rows, because you already deleted default values.

I think best approach is to:

  1. update qid = null for DefaultValue where 'question.qid IS NULL'
  2. delete DefaultValueL10n where DefaultValue.qid is null
  3. delete DefaultValue where DefaultValue.qid is null

In that case foreach loop won't be necessary.

DenisChenu

DenisChenu

2019-08-04 12:33

developer   ~53082

Last edited: 2021-03-22 14:59

I'm unsure on where to put the function …

Maybe

  1. Create QuestionL10n::fixQuestions($isurveyid); (and AnswerL10n etc …)
  2. This function get all language from survey, and delete all other QuestionL10n
  3. Create SurveyLanguageSetting::fixLanguage($isurveyid)
  4. Call all related function in this function

Currently : import any survey, delete : can import it again … even after fixDataIntegrity …

DenisChenu

DenisChenu

2019-08-04 12:42

developer   ~53083

Last edited: 2021-03-22 14:59

But more : currently : checkintegrity add "checkbox" for each Question. Did we really need to add checkbox ?
Then we need to add checkbox for each QuestionL10n too ?

Maybe best is

  1. First step add one checkbox for all fix to do : one checkbox for "Delete X questions"
  2. 2nd step delete whole Question using a deleteAll and not a for each …
c_schmitz

c_schmitz

2021-03-22 14:59

administrator   ~63528

Last edited: 2021-03-22 14:59

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=31367

lime_release_bot

lime_release_bot

2021-03-22 15:27

administrator   ~63541

Fixed in Release 4.4.14+210322

Related Changesets

LimeSurvey: master 0411b3cd

2021-03-22 14:58:18

c_schmitz

Details Diff
Fixed issue 14952: Check integrity does not delete orphaned localizations Affected Issues
14952
mod - application/controllers/admin/checkintegrity.php Diff File
mod - application/views/admin/checkintegrity/check_view.php Diff File

Issue History

Date Modified Username Field Change
2019-05-29 13:58 DenisChenu New Issue
2019-05-29 13:58 DenisChenu Status new => assigned
2019-05-29 13:58 DenisChenu Assigned To => DenisChenu
2019-05-29 14:02 DenisChenu Note Added: 52153
2019-05-29 14:02 DenisChenu Note Edited: 52153
2019-05-29 15:04 dominikvitt Note Added: 52160
2019-05-29 15:05 dominikvitt Note Edited: 52160
2019-08-04 12:33 DenisChenu Assigned To DenisChenu => dominikvitt
2019-08-04 12:33 DenisChenu Status assigned => feedback
2019-08-04 12:33 DenisChenu Note Added: 53082
2019-08-04 12:42 DenisChenu Note Added: 53083
2019-08-04 12:42 DenisChenu Status feedback => assigned
2019-08-06 10:08 dominikvitt Assigned To dominikvitt => cdorin
2019-08-27 12:44 cdorin Assigned To cdorin => LimeBot
2020-10-27 09:10 LimeBot Sync to Zoho Project => |Yes|
2021-03-22 14:59 c_schmitz Changeset attached => LimeSurvey master 0411b3cd
2021-03-22 14:59 c_schmitz Note Added: 63528
2021-03-22 14:59 c_schmitz Assigned To LimeBot => c_schmitz
2021-03-22 14:59 c_schmitz Resolution open => fixed
2021-03-22 14:59 c_schmitz Status assigned => resolved
2021-03-22 15:27 lime_release_bot Sync to Zoho Project Yes => |Yes|
2021-03-22 15:27 lime_release_bot Note Added: 63541
2021-03-22 15:27 lime_release_bot Status resolved => closed