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

Bug: Transactions already disposed #306

Open
PhMemmel opened this issue Sep 30, 2024 · 1 comment
Open

Bug: Transactions already disposed #306

PhMemmel opened this issue Sep 30, 2024 · 1 comment
Labels

Comments

@PhMemmel
Copy link
Contributor

Debug-Info:  Transactions already disposed
Error code: dmltransactionexception

Stack trace: 
line 103 of /lib/dml/moodle_transaction.php: dml_transaction_exception thrown
line 1969 of /mod/ratingallocate/locallib.php: call to moodle_transaction->rollback()
line 382 of /mod/ratingallocate/locallib.php: call to ratingallocate->save_ratings_to_db()
line 1262 of /mod/ratingallocate/locallib.php: call to ratingallocate->process_action_give_rating()
line 59 of /mod/ratingallocate/view.php: call to ratingallocate->handle_view()

To reproduce:

  • Create new ratingallocate instance
  • Configure times so voting is possible
  • Set Completion conditions to "Students must manually mark the activity as done"
  • As student go to the ratingallocate instance and try to vote, you will see the exception

Reason is the line $completion->update_state($this->coursemodule, COMPLETION_UNKNOWN, $userid); which throws an exception here: https://github.com/moodle/moodle/blob/30692df8495bd16fc579f4c448bb322ece29cf84/lib/completionlib.php#L649

I'm not too deep into the completion code so I cannot really see what exactly is the issue with the completion here unless investing a lot of time I currently unfortunately do not have.

But besides that I feel like the transaction handling should also be improved: Exceptions being caused after the transaction has been commited must not trigger the rollback.

Tested with latest master on latest vanilla main. Issue at least exists also since de61f8d.

@dlmsr dlmsr added the bug label Oct 1, 2024
@dlmsr
Copy link

dlmsr commented Oct 1, 2024

Thanks for the report. We will have a look :)

SpaceCafe pushed a commit to DL-MIN/moodle-mod_ratingallocate that referenced this issue Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants