Skip to content

Commit

Permalink
Fixed issue #17379: Question types can be uninstalled (#1939)
Browse files Browse the repository at this point in the history
Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
  • Loading branch information
gabrieljenik and encuestabizdevgit committed Aug 20, 2021
1 parent 6aa317b commit 45549a2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions application/models/QuestionTheme.php
Expand Up @@ -499,6 +499,18 @@ public static function uninstall($oQuestionTheme)
return false;
}

// Don't allow deletion of core question themes (themes delivered with Lime)
if ($oQuestionTheme->core_theme == 1) {
return [
'error' => gT('Core question themes cannot be uninstalled.'),
'result' => false
];
}

// TODO: Now that core question themes can't be deleted, the following check
// doesn't seem necessary because, at least for now, user question themes
// always extend a question type.

// if this questiontype is extended, it cannot be deleted
if (empty($oQuestionTheme->extends)) {
$aQuestionThemes = self::model()->findAll(
Expand Down

0 comments on commit 45549a2

Please sign in to comment.