Fix memory usage on integrity check (#6660)

This commit is contained in:
Yuriy Bakhtin 2023-11-16 14:44:28 +01:00 committed by GitHub
parent dfb8c846be
commit 5cdb26cfac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@ HumHub Changelog
- Fix #6645: File dropdown not visible at the bottom of the page
- Fix #6639: Apply image inline styles in email message
- Fix #6649: Fix birthday format on welcome page
- Fix #6660: Fix memory usage on integrity check
1.15.0 (November 6, 2023)

View File

@ -66,7 +66,7 @@ class Events extends \yii\base\BaseObject
$integrityController = $event->sender;
$integrityController->showTestHeadline("File Module (" . File::find()->count() . " entries)");
foreach (File::find()->all() as $file) {
foreach (File::find()->each() as $file) {
if ($file->object_model != "" && $file->object_id != "" && $file->getPolymorphicRelation() === null) {
if ($integrityController->showFix("Deleting file id " . $file->id . " without existing target!")) {
$file->delete();

View File

@ -26,7 +26,7 @@ class Events extends \yii\base\BaseObject
$integrityController = $event->sender;
$integrityController->showTestHeadline("Post Module - Posts (" . Post::find()->count() . " entries)");
foreach (Post::find()->all() as $post) {
foreach (Post::find()->each() as $post) {
/* @var Post $post */
if (empty($post->content->id)) {
if ($integrityController->showFix("Deleting post " . $post->id . " without existing content record!")) {