Skip to content

CTP4885 - Lifecycle plugin proj (with full commits) #301

Closed
ccaewan wants to merge 36 commits intolearnweb:mainfrom
ccaewan:45-extend
Closed

CTP4885 - Lifecycle plugin proj (with full commits) #301
ccaewan wants to merge 36 commits intolearnweb:mainfrom
ccaewan:45-extend

Conversation

@ccaewan
Copy link
Copy Markdown

@ccaewan ccaewan commented Apr 1, 2026

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

🔀 Purpose of this PR:

  • Adds a new feature of functionality

📝 Description:

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

  • Trigger: based on last access and creation date
  • Step to call UCLs contextfreeze task which archives courses
  • Trigger: Based on last access, creation date and archive status

📋 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 #[IssueNumber]

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

Any other relevant information.


ccaewan and others added 30 commits October 30, 2025 11:17
Updated to reduce risk of host timeout
Added error prevention for already deleted courses and commented out the delete_course function for testing.
*/
public function process_course($processid, $instanceid, $course) {

if (!class_exists('\block_lifecycle\manager')) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know this class: block_lifecycle\manager ... what is this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hi @bluetom apologies for the late response I have been on AL.
Block_lifecycle\manager is a reference to a scheduled task that archives courses (or makes read-only). I am not 100% sure how it came to be but I believe it was created within the organisation.

It successfully works with the CLC trigger as a step to archive active courses. However this code has issues when using the delete course step in succession

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So this step plugin works only within your organisation?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I believe the repo holding the logic is public and can be found here:
[https://github.com/ucl-isd/moodle-block_lifecycle](url)

Copy link
Copy Markdown
Author

@ccaewan ccaewan Apr 14, 2026

Choose a reason for hiding this comment

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

@bluetom
[https://github.com//pull/297] Shows a better updated version of these changes and I have also addressed a bug with course deletion errors. I will close this pull request to prevent further confusion.

@ccaewan ccaewan closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants