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

Enable logs retrieval after course deletion by storing metadata #2

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

vithushau
Copy link

This PR addresses the issue in #1

To Test

Create a test site with a course (use admin/tool/generator/cli/maketestsite.php).

Create a category where you can move the course into.

Move the course into the the newly created category.

Open admin/tool/lifecycle/workflowdrafts.php and click "Create new workflow" button.

Give the workflow a new title, then click "Save changes".

From the "Add new trigger instance" dropdown, select "Categories Trigger"

Give the new trigger a name, and Select the Category from the dropdown then click Save changes.

From the "Add new step instance" dropdown, select "Backup course log step"

Give the new step a name, then click "Save changes".

Open admin/tool/lifecycle/workflowdrafts.php and click the Activate button for the newly created workflow.

In a terminal execute the following command

php admin/cli/scheduled_task.php --execute="\tool_lifecycle\task\lifecycle_task"

After executing the task, make sure the log file is generated for that course by checking this link:

admin/tool/lcbackupcourselogstep/logs.php

After this, delete the course by going to /course/management.php and deleting the course that you used to create a log file.

Then, open this page: admin/tool/lcbackupcourselogstep/logs.php
Confirm you can still see the log file with the course name and ID (confirm in the database that the course is deleted and that the mdl_tool_lcbackupcourselogstep_metadata table contains this data).

@ScottVerbeek
Copy link
Contributor

Hi @vithushau please resolve the moodle-plugin-ci codechecker issues.

@vithushau vithushau force-pushed the issue-1 branch 3 times, most recently from 7755983 to 3abaf1b Compare October 22, 2024 00:51
Copy link
Contributor

@ScottVerbeek ScottVerbeek left a comment

Choose a reason for hiding this comment

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

Looks good to me thanks @vithushau

@ScottVerbeek ScottVerbeek merged commit abef0d4 into main Oct 22, 2024
15 of 24 checks passed
@ScottVerbeek ScottVerbeek deleted the issue-1 branch October 22, 2024 23:39
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