-
Notifications
You must be signed in to change notification settings - Fork 14
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 for availability in hidden sections #131
Conversation
35aee3b
to
7f4861a
Compare
@PhMemmel if you have a moment I wouldn't mind a second pair of eyes before I merge this. We were seeing this issue on 4.4+ and 4.5. |
Will have a look as soon as I find some time. Thanks for finding this and providing a fix! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This moodle feature is pretty confusing :)
I wonder if there is no moodle core function to handle this, so we do not have to rebuild the logic here, but I assume the answer is "no", otherwise we would already use it :)
I also tested this manually, works as intended, bug fixed.
I would suggest to add this case to the unit test function?
3d50043
to
da7b6eb
Compare
da7b6eb
to
abf8deb
Compare
b8685b2
to
e248d01
Compare
@PhMemmel ok I have rebased this change to the 4.5 version. I also reviewed the unit tests and it already tested correctly, however what we really needed was a behat test making sure that in all cases it was showing correctly to teachers and students. That is now done. However, in the case that somehow a hidden section module gets set to visible: 1 and visibleoncoursepage: 0, there is still the strange case that Moodle will select "Hidden from students" in the activity edit screen under Availability. Seems like a Moodle bug. The logic is (visible, visibleoncoursepage). |
I retested and to be honest the status under availability is correct for me? Or have I the wrong reproduction steps? |
@PhMemmel The steps were (using an older version of mass actions), Create a hidden course section. Place an activity in the hidden section. Use mass actions to make the activity in the hidden section available. It should show available. Edit the activity, and under Common module settings -> Availability it will show "Hide on course page". Another way is to manually set the activity in the hidden section to visible = 1 and visibleincourse = 0. |
I followed your steps. With this branch I cannot reproduce this anymore. It properly shows "available, but don't show on course page" in the activity edit form. So I think it can't become better than the current state it. Ready to merge I believe? |
Possible fix for #130