This class was rolling its own version of get_template_name, which
meant that calling code needed to first call get_template and was forced
to use render_from_template(). This fixes that by implementing the
named_templatable interface and the get_template_name method. Now,
renderables that extend comboboxsearch can just be passed to render()
for rendering.
This code was unnecessarily pre-rendering some context properties used
by the action_menu, which also meant the mustache template expected HTML
in the context, which should be avoided. Instead of pre-rendering, just
export_for_template() and adjust the mustache template to render the sub
template for the respective templatables. Doing this also reveals two
unecessary renderer methods which have now been deprecated.
This code was unnecessarily pre-rendering some context properties used
by the action_menu, which also meant the mustache template expected HTML
in the context, which should be avoided. Instead of pre-rendering, just
export_for_template() and adjust the mustache template to render the sub
template for the respective templatables.
This change:
- Fixes the group_selector constructor, removing the unnecessarily
deprecated param (this code is main-only, so no need to deprecate) and
fixes all calling code.
- moves the button and content into separate named_templatable
renderables, cleaning up the group_selector code so that it only needs
to make a single call to render and doesn't concern itself with contexts
of other renderables.
This change:
- Fixes naming of initials_selector class (making plural to match its
predecessor), and addresses relevant calling code.
- Adds an initials_dropdown_form renderable, templatable
- Removes superfluous course/classes/output/actionbar renderer
- Replaces the rendering logic inside initial_selector with calls to
render the new renderable
- Simplifies the initials_selector class, using instance vars instead of
passing args to helpers, removing unnecessary vars, etc.
This replaces the limit on the number of students per page with a number
of grades per page, to take into account the number of grade items on a
course.
Integrates a submissions page link into the assignment's secondary
navigation, eliminates the redundant 'View all submissions' button
from the assignment's homepage and updates the existing behat tests.
- Add SCSS code for float utility classes to the Boostrap 5 bridge SCSS file
- Replace all occurrences in the codebase (float-left > float-start, float-sm-right > float-sm-end, ...)
Deprecates the $course parameter in the constructor of the
core_course\output\actionbar\group_selector class. This parameter is no
longer used, as the $course object can now be obtained through the
$context class property. Additionaly, the $course class property has
been removed in accordance with this change.
The group selector component should be sensitive to the current context
to ensure accurate validation and retrieval of group settings
(e.g. group mode).
The comboboxsearch component now has uses beyond the grade subcomponent
and includes alternative step definitions in behat_general.php. This
change deprecates the redundant behat step definitions related to this
component in behat_grade.php and replaces current usages with the
alternative definitions.
Duplicate data provider keys were overwriting and/or duplicating
one another, leading to some cases being skipped.
Other "duplicate array key" errors were picked up by `phpcs` in
this dragnet across all tests, which have also been fixed.
All setUp(), tearDown(), setUpBeforeClass() and tearDownAfterClass()
must, always, call to parent, to ensure that everything is properly
set and cleaned.
While in a lot of situations this is not needed (parents may not
have anything to run), with PHPUnit >= 10 this can become more
important because we are going to move the reset code from current
placement @ runBare() to setUp()/tearDown().
Note that all the changes performed in this commit have been detected
and fixed by moodle-cs (ParentSetUpTearDownSniffTest).
While this change is not 100% required now, it's good habit
and we are checking for it since Moodle 4.4.
All the changes in this commit have been applied automatically
using the moodle.PHPUnit.TestReturnType sniff and are, exclusively
adding the ": void" return types when missing.