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 #129

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
4 changes: 2 additions & 2 deletions Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static function onIntegrityCheck($event)
{
$integrityController = $event->sender;
$integrityController->showTestHeadline("Polls Module - Answers (" . PollAnswer::find()->count() . " entries)");
foreach (PollAnswer::find()->joinWith('poll')->all() as $answer) {
foreach (PollAnswer::find()->joinWith('poll')->each() as $answer) {
if ($answer->poll === null) {
if ($integrityController->showFix("Deleting poll answer id " . $answer->id . " without existing poll!")) {
$answer->delete();
Expand All @@ -81,7 +81,7 @@ public static function onIntegrityCheck($event)
}

$integrityController->showTestHeadline("Polls Module - Answers User (" . PollAnswerUser::find()->count() . " entries)");
foreach (PollAnswerUser::find()->joinWith(['poll', 'user'])->all() as $answerUser) {
foreach (PollAnswerUser::find()->joinWith(['poll', 'user'])->each() as $answerUser) {
if ($answerUser->poll === null) {
if ($integrityController->showFix("Deleting poll answer id " . $answerUser->id . " without existing poll!")) {
$answerUser->delete();
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

1.3.5 (Unreleased)
----------------------
- Fix #129: Fix memory usage on integrity check

1.3.4 (November, 10, 2023)
--------------------------
- Enh #127: Tests for `next` version
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Polls",
"description": "Empower your users to create polls and survey to drive engagement and gather valuable insights from your community.",
"keywords": ["poll", "voting", "decision making"],
"version": "1.3.4",
"version": "1.3.5",
"humhub": {
"minVersion": "1.14"
},
Expand Down