This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing
All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.
Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
* Changing the name of an activity should change the access restriction messages.
* Introduction of a marker as data-cm-name-for to be able to change any
occurence of a course module name in the page when this one changes.
The UX team confirmed that an activity shouldn't be considered completed
when the criteria use a passing grade and the user gets a failing grade.
So the COMPLETION_COMPLETE_FAIL status won't be considered
completed from now on.
* Use a unique ID the date nodes in the HTML tree to be able to find the current node.
* Look for nodes in the same tree "leaf" and work on conflicts in this single leaf/branch.
- Create a new availability info selectors for section and activity data info regions
- Replace css_element by created selectors in the existing behat tests
- Create new availability template, so it can be reused from both
section/availability and cm/availability mustaches.
- When rendering activity or section restrictions with long or multiline text
display a condensed version (excerpt) and use 'showmore' component to add
showmore/showless behaviour.
Co-authored-by: Ferran Recio <ferran@moodle.com>
Replace steps that manually add page instances via the UI and use
Behat generators. This improves the speed of Behat test runs.
Co-authored-by: Simey Lameze <simey@moodle.com>
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
This allows an availability plugin to indicate that a selected condition
should be considered "private", and therefore should never be shown to
users who don't satisfy the criteria. The availability_groups plugin
uses this to protect visibility of groups that are not visible to
non-members.
When updating/deleting a section/module, the system now only
invalidate of the element (section/module), not the whole course cache
Also, the system now only recalculate the cache for element (section/module)
if necessary, not the whole course cache
Move module/section purging to course_modinfo:
+ course_modinfo::purge_course_section_cache_by_id was created to purge section by id
+ course_modinfo::purge_course_section_cache_by_number was created to purge section by number
+ course_modinfo::purge_course_module_cache was created to purge module
Applied the following changes to various testcase classes:
- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.
Special mention to:
- When belonging to other components and being valid api:
- analytics related tests have been moved to tests/analytics subdir.
- backup & restore related tests have been moved to tests/backup subdir.
- events related tests have been moved to tests/event subdir.
- privacy related tests have been moved to tests/privacy.
- task related tests have been moved to tests/task subdir.
- Some simple renames, not including the component part anymore (not
needed now that they are namespaced):
- some xxxlib_test.php have been renamed lib_test.php
(when they where testing the corresponding lib.php).
- cache stores tests have been all renamed store_test, originally
each one had its own name (file_test, apcu_test, redis_test...)
- assign feedback tests have been all renamed feedback_test, originally
each one had its own name (file_test, editpdf_test...)
The test script did not correctly rebuild course cache after changing a
cached value in database. While this did not cause failures in the past,
it will after upcoming changes.
The availability condition get_description method is called while
gathering data for the modinfo object. As such it is not safe to
call other functions which might rely on modinfo, such as format_string
(if using filters which access modinfo).
This change provides a mechanism to call format_string later, and also
a general callback to do other stuff later as well if needed. It uses
the same approach already taken to make activity names work correctly
in the availability_condition class.
With the default 5 sections course, after editing the activities, the
"log out" link is exactly on the edge of the view port. It's one of
those cases where Chrome fails to click/press it (have tried both).
So just make the course to have 3 sections is enough to avoid the
problem. Some day Chrome will fix that problem but, until then...
we cannot do much apart from changing the window size or try to
configure things to show differently.