To be integrated as part of MDL-81266
When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectHasProperty() instead."
So we replace all instances of assertObjectHasAttribute with
assertObjectHasProperty.
PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit. PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
In the activity action menu, show only the subpanel when the options are different
than show or hide. In those cases the show/hide option will be directly displayed
in the menu instead of a subpanel.
Co-authored-by: ferran@moodle.com
In the section settings page, replace the custom checkbox element
used for renaming with a standard input text field featuring a
placeholder.
This adjustment aims to enhance user experience by simplifying the
interaction and aligning with modern design standards.
The selector "I am on the "Course > Section" "course > section" page
has been improved to also support section number.
When "Section x" is given, and there is no section with this name,
section number "x" is used.
The behat tests using the course format topics have been reviewed to:
- Add the 'inisections' parameter where necessary, facilitating automatic
renaming of section names.
- Evaluate failing tests due to slight changes in ordering. Notably, in
the topics format, sections are now uniformly named 'New section' without
any numbering.
From now on, the default section name for the topics course format is
"New section" instead of "Topic x" (where x was the section number).
A new item, initsections, has been added to the create_course() function
in the testing_data_generator class, to let the generator rename the
sections to "Section X"
AMOS BEGIN
CPY [sectionname,format_topics],[legacysectionname,format_topics]
AMOS END
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.
- Created a new divider template to generate activity and section dividers
- Refactored templates and styles for the course sections for the new
section dividers
- Changed the topics format 'hasaddsection' property to 'true' so now adding
sections to the bottom of the course will be handled by the format instead
of the last section. Also re-styled this 'Add topic' button.
- Refactored templates and styles for the course activities for the new
activity dividers
- Fixed some related behat that failed because of these changes
- Moved blocks related SCSS to the blocks file and removed some unused SCSS
There is a new callback, <modname>_is_branded, which, by default,
returns false. It needs to be implemented by modules that want their
logo to be displayed as it is (so without applying any filter to
colour them based on their main purpose).
Courses, categories, users & cohorts each have a configurable `theme`
attribute - ensure reporting on said value is consistent across all the
corresponding entities.
The method for checking if the user can create an activity executed
create_if_missing wihtout checking the section exists or not. This is
a problem for delegated sections because create_if_missing will create a
regular section and push down all delegate ones. With the patch the
method first checks if the section exists.