Skip to content

Hotfix for anonymous Mail #214

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

Merged
merged 3 commits into from
May 21, 2025
Merged

Hotfix for anonymous Mail #214

merged 3 commits into from
May 21, 2025

Conversation

TamaroWalter
Copy link
Contributor

@TamaroWalter TamaroWalter commented May 19, 2025

Fixes problem adressed in #211, #202.

What was the problem?
It was a really funny problem. In the process of sending a notification mail of a new post, it's being checked twice (in different files and contexts) if the author of the post should be anonymous. Both checks function perfectly. The problem was, that the algorithm set the user-id to a negative integer after a first successful anonymous check. The second check works with the changed user-id integer and compares it to the original post user-id. Since the user-ids are not equal, the user was wrongly set as "non-anonymous". This happened especially in half-anonymous forums, as in those the anonymous status is being checked by user-id.

What is the solution?
After the first check, the anonymous status of the author is being saved in a variable. The second anonymous check is being replaced by simply checking the previous set variable.

Important!
This is only a hotfix. The email-system still needs a redesign that can be followed on #212.

Copy link
Contributor

@bluetom bluetom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please increase the version of this release like this:
old "version": 2025050600
new "version": 2025050601
old "release": 'v4.5-r1'
new "release": 'v4.5-r2'
And update file changes.md by adding:
4.5.1 (2025-05-17)
[HOTFIX] #214

@TamaroWalter TamaroWalter requested a review from bluetom May 20, 2025 12:30
Copy link
Contributor

@bluetom bluetom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, there are still misunderstandings, I'm afraid. I try to make it clearer. Thank you!

Here the version.php lines exactly as I would like them to be (after Moodle standards):

$plugin->component = 'mod_moodleoverflow';
$plugin->version = 2025050601;
$plugin->requires = 2022112800;
$plugin->release = 'v4.5-r2';
$plugin->supported = [401, 405];
$plugin->maturity = MATURITY_STABLE;

In the changes.md file the sort order is usually from new to old:

4.5.1 (2025-05-19)

[HOTFIX] #214 Hotfix for anonymous Mail

4.5.0 (2025-05-06)

  • Moodle 4.5 compatible version

@TamaroWalter TamaroWalter requested a review from bluetom May 20, 2025 13:07
@TamaroWalter
Copy link
Contributor Author

Ahh I see. I never knew how the version.php should be done after the Moodle standards. I thought the version should be equal to the current date 😅.

@TamaroWalter TamaroWalter removed the request for review from dlmsr May 20, 2025 18:57
@TamaroWalter TamaroWalter merged commit 0702bd3 into main May 21, 2025
30 checks passed
@TamaroWalter TamaroWalter deleted the fix/anonymousmail branch May 21, 2025 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug High Priority This has a high priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants