3055 Commits

Author SHA1 Message Date
Laurent David
fc72a1d7b1 MDL-75337 core: Single button - core changes
* Change all core calls toward single_button to use single_button::BUTTON_PRIMARY
    when needed
2023-01-24 06:01:35 +01:00
Andrew Nicols
7000a99de3 MDL-76362 core: Coding style fixes 2023-01-23 09:15:55 +08:00
Marina Glancy
b0a83aa7bd MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:15:54 +08:00
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
Tim Hunt
3b23ff6fec MDL-76810 redirect handling: ensure return URLs are properly sanitised 2023-01-11 11:42:28 +08:00
Tim Hunt
a9f8547599 MDL-76614 quiz: rename quiz => mod_quiz\quiz_settings 2023-01-06 14:35:54 +00:00
Tim Hunt
5682c8c70e MDL-76614 quiz: move class quiz_attempt => mod_quiz\quiz_attempt
I thought about renaming the class to just plain attempt, but I
acutally think quiz_attempt makes it clearer what this is. Also
not changing the name massively reduces the pain for everyone
updating their code (including me right now!)
2023-01-06 14:35:51 +00:00
Sara Arjona
315f1dafd8 Merge branch 'MDL-76193-master' of https://github.com/JBThong/moodle 2022-12-07 17:26:11 +01:00
Andrew Nicols
425d4f2583 Merge branch 'MDL-75573' of https://github.com/paulholden/moodle 2022-12-06 13:54:26 +08:00
Sara Arjona
46114474e4 Merge branch 'MDL-75789' of https://github.com/paulholden/moodle 2022-12-05 12:53:36 +01:00
Thong Bui
79d1b45ba7 MDL-76193 Questions: Backup and Restore with tags fails 2022-12-05 10:00:37 +07:00
Paul Holden
be83010d4f MDL-75573 backup: translate async operation type in messages. 2022-12-01 19:48:29 +00:00
Ilya Tregubov
9ba9589f09 Merge branch 'MDL-74853-master' of https://github.com/marinaglancy/moodle 2022-12-01 08:55:34 +03:00
Paul Holden
e5c6575bbd MDL-75789 restore: multi-byte safe substring calculating course names.
Co-authored-by: Leon Stringer <leon.stringer@ntlworld.com>
2022-11-29 08:32:22 +00:00
Marina Glancy
a800e7e62f MDL-74853 various: add second parameter to htmlentities functions
Default value of the $flag argument changed in PHP 8.1 from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE
To ensure consistent behavior across different PHP version the second parameter is now required for the functions:
htmlspecialchars(), htmlentities(), htmlspecialchars_decode(), html_entity_decode() and get_html_translation_table()
2022-11-28 16:12:20 +01:00
Eloy Lafuente (stronk7)
b2ffea4ac0 MDL-76496 backup: Bump release to 4.2 2022-11-26 23:56:08 +01:00
Jun Pataleta
00bae8b8a4 MDL-76403 versions: bump all versions and requires near release 2022-11-23 09:45:23 +08:00
Adrian Greeve
f865b326ca Merge branch 'MDL-76099-master' of https://github.com/stevandoMoodle/moodle 2022-11-11 12:26:12 +08:00
Paul Holden
8aaede0e7d MDL-75862 backup: omit sesskey for continue buttons using get method.
It's automatically added by the rendered single_button instance when
using post method, so no need to add it unconditionally.
2022-11-10 10:17:04 +08:00
Jake Dallimore
36a0c85187 MDL-76099 core_backup: set selected overflow node in restore and copy
These pages sit under the 'restore' and 'copy' menu items respectively
but the selected menu item isn't correct because the 'restore.php' and
'copyprogress.php' page URLs don't match the node action for their
respective 'restore' and 'copy' nodes. Force set the selected node in
each case to resolve this.
2022-11-09 15:15:50 +08:00
Frédéric Massart
3345519b48 MDL-74201 backup: Restore reference to content bank files 2022-11-08 20:13:14 +01:00
Sara Arjona
4cf81fd3c2 Merge branch 'MDL-73030' of https://github.com/paulholden/moodle 2022-10-24 15:47:21 +02:00
Ilya Tregubov
057f732bf1 Merge branch 'MDL-58266-master' of https://github.com/JBThong/moodle 2022-10-17 12:51:59 +03:00
Matthew Hilton
cfb643293c MDL-56567 competency: Course module competency option to override grade
Previously, if a course module had already been graded, course module
completion linked to the course module would not update. This
commit adds the option to enable overriding the grade at the course
module competency level.

This ensures that if enabled and a user completes a module associated
with a competency, that competency will be graded appropriately.
2022-10-17 08:00:20 +10:00
hieuvu
c6e018e04e MDL-58266 core_completion: Add new view table. 2022-10-14 00:30:28 +07:00
Marina Glancy
41b93bd7e5 MDL-73424 general: Internal methods must have same type as parent
Otherwise the error is thrown in PHP8.1
2022-10-10 16:46:13 +02:00
Paul Holden
65f9976478 MDL-73030 backup: case-insensitive detection of Moodle backups. 2022-10-03 09:32:17 +01:00
Jake Dallimore
ad46fbf76c Merge branch 'mdl75668' of https://github.com/danmarsden/moodle 2022-09-28 16:34:12 +08:00
Dan Marsden
ddcd4de74d MDL-75668 backup: Save context mapping of duplicate blocks. 2022-09-07 12:38:56 +12:00
David Mudrák
aa49eb24fb MDL-75553 lang: Fix Behat regressions in scenario files 2022-09-06 21:47:18 +02:00
Philipp Memmel
9a8e108655 MDL-75092 backup: Fix selector for adding select all/none link 2022-08-19 17:17:29 +02:00
Tim Hunt
8babdbd396 MDL-74608 activities: a new option to force the activity language
For a long time, Moodle has had the feature to force the language
for a whole course. This change adds the same feature at activity
level.

The course-level feature was controlled by a capability
moodle/course:setforcedlanguage, and I decided to use the same
capability to control this feature. I think a new capability would be
overkill.
2022-08-15 22:15:52 +01:00
Andrew Nicols
b32b4865c0 Merge branch 'MDL-73788-master' of https://github.com/andelacruz/moodle 2022-07-26 11:37:51 +08:00
Angelia Dela Cruz
2b28996a2e MDL-73788 behat: URL behat generators use UI
Replace steps that manually add URL instances via the UI and use
Behat generators. This improves the speed of Behat test runs.
2022-07-18 17:40:22 +08:00
Iñigo Zendegi
919ea1dde1 MDL-74857 language: Start using the 'statusok' string for status 2022-07-18 10:55:47 +02:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Cameron Ball
2ac93db399 MDL-74548 backup: Deprecate get/set copy from base controller 2022-06-29 09:14:02 +08:00
Cameron Ball
07e5f432a0 MDL-74548 backup: Deprecate core_backup\copy\copy 2022-06-29 09:14:02 +08:00
Cameron Ball
bc9c536335 MDL-74548 backup: Unit tests for course copy refactor 2022-06-29 09:13:29 +08:00
Cameron Ball
29df52af19 MDL-74548 backup: Refactor course copies
This patch modifies the way copy data is shared in order to mitigate potential race conditions
and ensure that the serialised controller stored in the DB is always in a valid state.

The restore controller is now considered the "source of truth" for all information about the
copy operation. Backup controllers can no longer contain information about course copies.

As copy creation is not atomic, it is still possible for copy controllers to become orphaned or
exist in an invalid state. To mitigate this the backup cleanup task has been modified to call
a new helper method copy_helper::cleanup_orphaned_copy_controllers.

Summary of changes in this patch:

    - Copy data must now be passed through the restore controller's constructor
    - base_controller::get_copy has been deprecated in favour of restore_controller::get_copy
    - base_controller::set_copy has been deprecated without replacement
    - core_backup\copy\copy has been deprecated, use copy_helper.class.php's copy_helper instead
    - backup_cleanup_task will now clean up orphaned controllers from copy operations that went awry

Thanks to Peter Burnett for assiting with testing this patch.
2022-06-29 09:13:29 +08:00
Nathan Mares
1da1152baa MDL-72723 logs: Add get_events_select_exists to the sql_reader interface
- Updates to log stores and backup helper to improve performance when
  checking if a course has been modified.
- This is a breaking change as it adds a new function on the sql_reader
  interface.

Co-authored-by: Kevin Pham <keevan.pham@gmail.com>
2022-05-30 10:42:47 +10:00
Jake Dallimore
be4352bd3e Merge branch 'MDL-73801' of https://github.com/paulholden/moodle 2022-05-26 12:10:18 +08:00
Peter Burnett
3801662e97 MDL-71198 backup: Change times on restore file duplication 2022-05-25 22:18:36 +08:00
Paul Holden
cf57505ce7 MDL-73801 backup: set predictably ordered backup next start time.
Prior to this change, the testcase would assert ordering based on
identical fields which could lead to random failures. Set distinct
next start time of course backup, and also remove random ordering
by sorting on defined course order (all other fields being equal).
2022-05-19 08:18:06 +01:00
Eloy Lafuente (stronk7)
9f53b0e965 MDL-73971 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:

- Some fixtures, initially defined in the test files have been
  moved to new files in fixtures subdirectory, leaving the unit
  test files clearer:
  - moodle2_course_format_test.php
- Rename wrong named test:
  - baseoptiogroup_test = baseoptigroup_test
2022-05-06 18:29:11 +02:00
Ilya Tregubov
df86854461 Merge branch 'mdl65478-fix-master' of https://github.com/matthewhilton/moodle 2022-05-03 15:43:53 +06:00
Jason den Dulk
ba53ec733a MDL-65478 backup, course format: Handle editor elements in course format
Modified course format options reading and writing to be able to handle Editor elements by enabling them to split array values into
multiple values before inserting into database, and combining multiple values into an array when reading from the database.
Modified backup and restore code to use backup_nested_elements, and to interact directly with the database.

Co-authored-by: Jason den Dulk <jasondendulk@catalyst-au.net>
Co-authored-by: Matthew Hilton <matthewhilton@catalyst-au.net>
2022-05-03 14:23:37 +10:00
Eloy Lafuente (stronk7)
3d709bb968 MDL-74509 backup: Bump release to 4.1 2022-04-22 18:45:05 +02:00
Jun Pataleta
70f6b1605b MDL-74471 versions: bump all versions and requires near release 2022-04-13 10:37:36 +08:00
Tim Hunt
839cccead4 MDL-74255 quiz: handle draft question status correctly
The main issue to fix is that questions vesions which should not have
been used (that is, hidden or draft versions) were getting offered
as an option and acutally being used.

As part of this I was able to substantially un-tangle
mod_quiz\question\bank\qbank_helper, which previously was
a mass of functions calling other functions in a complicated way.
Hopefully, it is now a bit easer to understand, and perhaps
less buggy.
2022-04-08 12:19:53 +01:00