Fix #3176: Integrity checker removes modules default state

This commit is contained in:
Lucas Bartholemy 2018-07-02 13:20:28 +02:00
parent ef5e0fdad9
commit 6902909730
3 changed files with 7 additions and 6 deletions

View File

@ -13,6 +13,7 @@ HumHub Change Log
- Fix: Incorrect last visit date shown in space admin pending members view (acs-ferreira)
- Enh: Allow enable/disable modules by CLI
- Enh: Added UTC only timezone in server timezone dropdown
- Fix #3176: Integrity checker removes modules default state
1.2.7 (May 23, 2018)

View File

@ -93,7 +93,7 @@ class Events extends \yii\base\Object
$integrityController->showTestHeadline("Space Module - Module (" . models\Module::find()->count() . " entries)");
foreach (models\Module::find()->joinWith('space')->each() as $module) {
if ($module->space == null) {
if ($module->space == null && !empty($module->space_id)) {
if ($integrityController->showFix("Deleting space module " . $module->id . " without existing space!")) {
$module->delete();
}

View File

@ -130,7 +130,7 @@ class Events extends \yii\base\Object
$integrityController->showTestHeadline("User Module - Modules (" . models\Module::find()->count() . " entries)");
foreach (models\Module::find()->joinWith(['user'])->each() as $module) {
if ($module->user == null) {
if ($module->user == null && !empty($module->user_id)) {
if ($integrityController->showFix("Deleting user-module " . $module->id . " of non existing user!")) {
$module->delete();
}