148 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
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.
2024-02-28 23:33:26 +01:00
Laurent David
8ee075d871 MDL-71665 core_courseformat: Sync activity name in the page
* 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.
2024-01-29 09:00:30 +01:00
Jun Pataleta
10744550e6
Merge branch 'MDL-79029-main' of https://github.com/ferranrecio/moodle 2024-01-23 09:26:30 +08:00
Ferran Recio
f4adbc8a11 MDL-79029 behat: replace deprecated behat steps 2024-01-22 11:12:28 +01:00
Sara Arjona
800ddf513d
MDL-80248 behat: Fix behat tests 2024-01-19 12:03:36 +01:00
Sara Arjona
9ced468959
MDL-79367 availability: Fail grade does not mark activities as completed
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.
2023-10-16 07:51:27 +02:00
Jun Pataleta
94bc2cd38b
MDL-79551 versions: bump all versions and requires near release 2023-10-04 13:57:17 +08:00
Laurent David
8790501437 MDL-76713 core_availability: Fix date restriction conflict
* 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.
2023-09-25 10:16:44 +02:00
Amaia Anabitarte
b87b72195c MDL-78527 core_completion: Fixing tests 2023-09-12 15:43:49 +02:00
Amaia Anabitarte
b9a840f638 MDL-78288 behat: New availability info selectors
- Create a new availability info selectors for section and activity data info regions
- Replace css_element by created selectors in the existing behat tests
2023-07-12 14:22:56 +02:00
Mikel Martín
045f8cb50d MDL-78204 course: Use 'showmore' component in course restrictions
- 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>
2023-06-28 15:08:13 +02:00
Angelia Dela Cruz
fb9745ab0b MDL-74021 behat: Page behat generators use UI
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>
2023-06-19 17:03:02 +08:00
Angelia Dela Cruz
c95ef35b60 MDL-70152 behat: Forum behat generators use UI
Behat cleanup and optimisation
2023-05-29 10:32:20 +08:00
Meirza
47fd891039 MDL-77350 availability: Added class properties that are not declared
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.
2023-05-16 01:03:01 +07:00
Eloy Lafuente (stronk7)
061c9d7ba0 MDL-77940 versions: bump all versions and requires near release
version = 2023042400 release version
requires= 2023041800 current rc1 version
2023-04-18 18:08:09 +02:00
Ilya Tregubov
3df60a19fd MDL-68093 workshop: Rebuilt js files. 2023-03-15 11:00:07 +08:00
Mark Johnson
cab6e97c1f MDL-68093 availability: Add support for private rule sets
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.
2023-03-14 08:52:25 +00:00
Jun Pataleta
8441270181 Merge branch 'MDL-77559-master-2' of https://github.com/andrewnicols/moodle 2023-03-09 16:02:01 +08:00
Andrew Nicols
511401f4f6 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Paul Holden
81e74af17f MDL-77046 availability: validate profile field in condition. 2023-03-08 10:23:55 +08:00
Andrew Nicols
33b1e41f13 MDL-75012 js: Full build of all grunt things 2023-03-02 11:55:32 +08:00
Simey Lameze
64799f9ace MDL-76542 behat: add step to go to user edit page directly 2023-02-08 12:22:29 +08:00
Ilya Tregubov
385721f022 Merge branch 'MDL-74756-master' of https://github.com/sh-csg/moodle 2023-01-19 10:29:35 +08:00
Stefan Hanauska
a9149c13af MDL-74756 availability_completion: Prev activity (completion n/enabled) 2023-01-16 22:20:48 +01:00
Paul Holden
af8da7c737 MDL-70070 phpunit: correct data provider method names.
They should not be prefixed `test_` because that's how actual
test methods containing assertions are identified by PHPUnit.
2023-01-16 08:28:37 +00:00
Dani Palou
6ab826fb23 MDL-75788 behat: Use profile field generators in existing tests 2022-12-02 14:54:47 +08:00
Andrew Nicols
08a19dbed8 Merge branch 'MDL-76403-master' of https://github.com/junpataleta/moodle 2022-11-24 10:18:22 +08:00
Víctor Déniz
d4de7b630e MDL-76395 lang: Use fixed strings in tests 2022-11-23 17:03:58 +00:00
Helen Foster
74828e8149 MDL-76395 lang: Import fixed English strings (en_fix) 2022-11-23 17:03:58 +00:00
Jun Pataleta
00bae8b8a4 MDL-76403 versions: bump all versions and requires near release 2022-11-23 09:45:23 +08:00
Julien Boulen
7321b16ecb MDL-75792 availability: sort groupings list by name 2022-11-14 13:08:04 +01:00
Hien Dinh
59cb744ead MDL-72490 availability: Show error if conflict in date restriction 2022-09-26 11:21:49 +01:00
Jun Pataleta
70f6b1605b MDL-74471 versions: bump all versions and requires near release 2022-04-13 10:37:36 +08:00
Dongsheng Cai
f97b86e841 MDL-72991 Course: Partial course cache rebuild
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
2022-03-17 15:34:01 +07:00
Eloy Lafuente (stronk7)
4003e31983 MDL-73785 phpunit: Move more tests to use correct names and namespaces
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...)
2022-03-03 12:19:30 +01:00
Simey Lameze
047a947879 MDL-73756 availability: remove modinfo parameter from get_data call 2022-03-01 10:21:56 +08:00
Andrew Nicols
641240ce63 Merge branch 'MDL-72837-master' of https://github.com/sammarshallou/moodle 2022-02-25 10:59:54 +08:00
sam marshall
416e0bc27f MDL-72837 core_availability: Fix minor problem with test script
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.
2022-02-23 16:38:37 +00:00
Andrew Nicols
aa7f7957ea MDL-73915 js: Upgrade babel and eslint 2022-02-23 08:53:54 +08:00
Mathew May
b983003e2e MDL-70197 navigation: Remove old navigation elements and migrate behat 2021-11-29 15:47:42 +08:00
Adrian Greeve
b72fa5fbae MDL-71912 behat: Updating various tests using assign steps. 2021-11-09 11:24:08 +08:00
Víctor Déniz
6c920c9f56 Merge branch 'MDL-72995-master' of https://github.com/ilyatregubov/moodle 2021-11-04 23:42:31 +00:00
Ilya Tregubov
ac93013cd1 MDL-72995 core_course: Revert "MDL-55231: Partial course cache rebuild"
This reverts commits c1468388bcecec43e671335db8edfc839494e710,
c1468388bcecec43e671335db8edfc839494e710 and
9a900492bc14176c4f56b8e600ef459069a3ec7a.
2021-11-04 11:57:58 +02:00
Angelia Dela Cruz
89c4c803e8 MDL-72655 behat: Use assign generators
Replace steps that manually add assignment instances via the UI
and use Behat generators. This improves the speed of Behat test
runs.
2021-11-03 11:34:26 +08:00
Dongsheng Cai
9a900492bc MDL-55231 core_course: Partial course cache rebuild 2021-10-26 19:08:15 +11:00
sam marshall
4dd7f2ac54 MDL-72339 core_availability: Unsafe to use format_string in description
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.
2021-10-06 11:28:26 +01:00
Jun Pataleta
385438b463 Merge branch 'MDL-72589' of https://github.com/stronk7/moodle 2021-09-16 09:46:56 +08:00
Eloy Lafuente (stronk7)
8fac400199 MDL-72589 behat: Create course with 3 sections (workaround)
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.
2021-09-15 20:25:33 +02:00
Mihail Geshoski
7d821080f0 MDL-72093 navigation: Update behat tests 2021-09-14 12:02:35 +08:00
Andrew Nicols
776f4bd80c MDL-72179 behat: Make use of page resolvers 2021-07-26 15:14:28 +08:00