Skip to content

Conversation

@KBorm
Copy link
Contributor

@KBorm KBorm commented Nov 12, 2025

Note: Please fill out all relevant sections and remove irrelevant ones.

🔀 Purpose of this PR:

  • Fixes a bug
  • Updates for a new Moodle version
  • Adds a new feature of functionality
  • Improves or enhances existing features
  • Refactoring: restructures code for better performance or maintainability
  • Testing: add missing or improve existing tests
  • Miscellaneous: code cleaning (without functional changes), documentation, configuration, ...

📝 Description:

Please describe the purpose of this PR in a few sentences.

  • What feature or bug does it address?
    adminapprove: a new record must only be inserted if there is no record for this processid yet

  • Why is this change or addition necessary?
    In case the check is missing there will be a duplicate key violation
    when handling further courses.
    Those courses will not be handled by the workflow

  • What is the expected behavior after the change?
    No errors and all courses shall be selected


📋 Checklist

Please confirm the following (check all that apply):

  • I have phpunit and/or behat tests that cover my changes or additions.
  • Code passes the code checker without errors and warnings.
  • Code passes the moodle-ci/cd pipeline on all supported Moodle versions or the ones the plugin supports.
  • Code does not have var_dump() or var_export or any other debugging statements (or commented out code) that
    should not appear on the productive branch.
  • Code only uses language strings instead of hard-coded strings.
  • If there are changes in the database: I updated/created the necessary upgrade steps in db/upgrade.php and
    updated the version.php.
  • If there are changes in javascript: I build new .min files with the grunt amd command.
  • If it is a Moodle update PR: I read the release notes, updated the version.php and the CHANGES.md.
    I ran all tests thoroughly checking for errors. I checked if bootstrap had any changes/deprecations that require
    changes in the plugins UI.

🔍 Related Issues

  • Related to #

🧾📸🌐 Additional Information (like screenshots, documentation, links, etc.)

Any other relevant information.

Scenario to reproduce:

  1. Create Category trigger with admin approve step
  2. Activate and start trigger
  3. not all courses will be selected and there will be many errors in the error table

@KBorm KBorm changed the title bugfix: insert into table only if it does not yet exist bugfix: adminapprove: insert into table only if it does not yet exist Nov 12, 2025
@KBorm KBorm closed this Nov 12, 2025
@KBorm
Copy link
Contributor Author

KBorm commented Nov 12, 2025

I need to do more research to see if this is the right solution for the problem.

@KBorm KBorm reopened this Nov 12, 2025
@KBorm
Copy link
Contributor Author

KBorm commented Nov 12, 2025

Seems to be ok after all

@bluetom bluetom self-assigned this Nov 18, 2025
@bluetom bluetom merged commit 20ed5b2 into learnweb:main Nov 24, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants