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

Fix Course Teacher going out of sync with Course Lessons #7600

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

markcummins
Copy link
Contributor

Resolves #7599

Proposed Changes

This code syncs the Lesson Author and the Course Author (or Course Teacher). It ensures that the lesson author is the same as the course author, and makes sure that the current Course Teacher is able to access and edit all of the lessons in the course.

Testing Instructions

  1. Create a New Course and Lessons (e.g. Lesson A and Lesson B)
  2. Set the Course Teacher to be another User
  3. Add another Lesson and assign it to the Course (e.g. Lesson C)
  4. Log in as the Course Teacher

Before the update, the course teacher would not be able to edit Lesson C, as they would not be the Author of the lesson. After the update, they would be able to edit all the lessons in the course.

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Legacy courses (course without blocks) are tested
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues

@markcummins markcummins changed the title Lesson author sync Fix Course Teacher going out of sync with Course Lessons Apr 25, 2024
@merkushin
Copy link
Member

Hi @markcummins!

Thanks for the contribution.
I tested the PR and it works well.

Could you please address the issues from the PR checks:

As for the changelogger, you need to add a changelog entry. For this purpose,

  • Run the following command in the repo directory and follow the instructions: composer exec changelogger add.
  • Commit and push the changes.

@merkushin merkushin added this to the 5.0.0 milestone May 17, 2024
@merkushin merkushin assigned merkushin and unassigned merkushin May 17, 2024
@merkushin merkushin self-requested a review May 17, 2024 14:50
Copy link
Member

@merkushin merkushin left a comment

Choose a reason for hiding this comment

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

I'm adding this formal review comment for internal purposes.

See my previous comment here:
#7600 (comment)

@m1r0 m1r0 modified the milestones: 5.0.0, 4.24.1 Jun 4, 2024
@markcummins
Copy link
Contributor Author

Hi, apologies for not following up on this and thanks for your instructions. I set up the environment properly locally so I could run the tests. This last commit should fix the three tests that were failing.

@donnapep donnapep modified the milestones: 4.24.1, 4.24.2 Jun 13, 2024
@donnapep donnapep modified the milestones: 4.24.2, 4.24.3 Aug 7, 2024
@donnapep donnapep removed this from the 4.24.3 milestone Aug 22, 2024
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.

Course Teacher goes out of sync if a new Lesson is added after a Course is published
4 participants