View Issue Details

IDProjectCategoryView StatusLast Update
14952Bug reports[All Projects] Otherpublic2019-05-29 15:05
ReporterDenisChenuAssigned ToDenisChenu 
Status assignedResolutionopen 
Product Version4.0.0-beta 
Target VersionFixed in Version 
Summary14952: Checkintegrity didn't delete question_l10ns and other

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.
Complete LimeSurvey version number (& build)4.0.0 github 1c4b7e853cbd3956c9aea525922df2a90e7019b2
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database & DB-Versionnot relevant ?
Server OS (if known)not relevant ?
Webserver software & version (if known)not relevant ?
PHP Versionnot relevant ?




2019-05-29 14:02

developer   ~52153

Last edited: 2019-05-29 14:02

View 2 revisions

@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 ?



2019-05-29 15:04

developer   ~52160

Last edited: 2019-05-29 15:05

View 2 revisions

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.

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 View Revisions
2019-05-29 15:04 dominikvitt Note Added: 52160
2019-05-29 15:05 dominikvitt Note Edited: 52160 View Revisions