Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory usage on integrity check #6660

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion protected/humhub/modules/file/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static function onIntegrityCheck($event)
$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();
Expand Down
2 changes: 1 addition & 1 deletion protected/humhub/modules/post/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static function onIntegrityCheck($event)
$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!")) {
Expand Down
Loading