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

@ -15,7 +15,7 @@ use yii\web\HttpException;
/**
* Events provides callbacks for all defined module events.
*
*
* @author luke
*/
class Events extends \yii\base\Object
@ -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

@ -13,7 +13,7 @@ use humhub\modules\user\models\Follow;
/**
* Events provides callbacks for all defined module events.
*
*
* @author luke
*/
class Events extends \yii\base\Object
@ -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();
}
@ -153,7 +153,7 @@ class Events extends \yii\base\Object
/**
* Tasks on hourly cron job
*
*
* @param \yii\base\Event $event
*/
public static function onHourlyCron($event)
@ -161,7 +161,7 @@ class Events extends \yii\base\Object
foreach (Yii::$app->authClientCollection->getClients() as $authClient) {
if ($authClient instanceof authclient\interfaces\AutoSyncUsers) {
/**
* @var authclient\interfaces\AutoSyncUsers $authClient
* @var authclient\interfaces\AutoSyncUsers $authClient
*/
$authClient->syncUsers();
}