123 Commits

Author SHA1 Message Date
Mark Johnson
ea01fb2427 MDL-67020 Cache: Make local caching work for coursemodinfo 2022-10-20 11:31:33 +01:00
Mark Johnson
dcc7d7b8df MDL-67020 Cache: Increment cacherev when purging course cache 2022-10-19 09:04:33 +01:00
Víctor Déniz
ab764c0062 Merge branch 'MDL-75736-master' of https://github.com/sammarshallou/moodle 2022-10-14 16:09:01 +01:00
sam marshall
18dc2a50ab MDL-75736 lib: Course cache can be rebuilt unnecessarily
This change puts back the behaviour that get_fast_modinfo will accept
a cached version of modinfo that is newer than expected (according to
the course cacherev).

Not accepting newer versions can lead to poor performance in cases
where multiple requests take place at once, or using a clustered
database.
2022-10-11 16:56:21 +01: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
Mikhail Golenkov
db04ed91ae MDL-74993 course: Output cm id when throwing Invalid course module id 2022-09-12 14:17:25 +10: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
Simey Lameze
c85b88c1b6 MDL-74967 core: deprecate groupmember hack from USER object 2022-06-29 04:55:42 +08:00
Tim Hunt
5fff990e25 MDL-74255 quiz: clean up lots of stuff mainly in the tests
This fixes lots of stuff like outdated or incomplete PHPdoc comments
or test heler functions where the arguments don't have their types
declared.

A few more significant fixes, like places were a silly method
was used to get a context which was readily available.
2022-04-08 12:19:52 +01:00
Andrew Nicols
e4aa381679 MDL-74235 mod: Update mod icon to use monologo 2022-04-07 13:27:18 +06:00
Huong Nguyen
bfe14e2312 MDL-72991 Course: Partial course cache rebuild with cache versioning 2022-03-17 15:34:26 +07:00
Huong Nguyen
4bc2b24a51 MDL-72991 Course: Modify the courseminfo cacheid to force a rebuild
Co-authored-by: Andrew Lyons <andrew@nicols.co.uk>
2022-03-17 15:34:26 +07: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
Sara Arjona
9b5da4de17 Merge branch 'MDL-73993-master' of https://github.com/golenkovm/moodle 2022-03-09 13:24:29 +01:00
Mikhail Golenkov
8c914c8756 MDL-73993 phpdoc: get_module_types_names returns lang_string objects 2022-03-03 10:39:09 +11:00
Andrew Nicols
6544843894 Merge branch 'MDL-73762-master' of https://github.com/ferranrecio/moodle 2022-03-01 09:35:59 +08:00
Ferran Recio
23856b1086 MDL-73762 core_courseformat: refactor cm and section outputs 2022-02-25 13:35:23 +01:00
sam marshall
02bb326314 MDL-72837 core_cache: Use versioned cache for modinfo
Uses the new versioned cache feature for modinfo, which should make it
safe as a localisable cache.
2022-02-24 13:51:07 +00:00
Simey Lameze
89e59a60ef MDL-69561 mod: handle content download on course modules 2021-11-11 18:38:53 +08: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
Dongsheng Cai
9a900492bc MDL-55231 core_course: Partial course cache rebuild 2021-10-26 19:08:15 +11:00
Peter
90acd8d381 MDL-52206 core: Add completion criteria to course_modules 2021-10-04 19:44:02 +08:00
Ferran Recio
21d93554d4 MDL-71863 courseformat: create courseformat subsystem 2021-06-28 13:50:18 +02:00
Sara Arjona
6347b916bc MDL-71165 course: core_course_update_course external method 2021-06-14 14:36:20 +08:00
Huong Nguyen
3e2570611f MDL-71486 course: Notice when in site home/course page 2021-04-29 14:42:49 +07:00
Shamim Rezaie
4ddc9fe0f4 MDL-71410 core: Prevent recursively calling getters 2021-04-27 14:32:26 +10:00
Shamim Rezaie
14e37590bb MDL-71410 core: Introduce override_customdata()
The get_custom_data() method now calls obtain_dynamic_data() because
$this->customdata can be dynamic now.
2021-04-26 05:28:36 +10:00
Víctor Déniz
4d0292b3b5 Merge branch 'MDL-70537-master' of https://github.com/sammarshallou/moodle 2021-03-26 20:14:19 +00:00
sam marshall
c89ea6733c MDL-70537 Availability: Avoid recursive calls to $cm->name
These recursive calls didn't work in PHP 7.3 and below, but in PHP
7.4 they also cause a fatal error which means if you have invalid
availability data, the whole page might die.
2021-03-18 15:54:17 +00:00
Ferran Recio
1c839f9072 MDL-65974 course: move format_base to core_course\course_format 2021-03-11 17:36:34 +01:00
Mark Johnson
d91aa1e760 MDL-65327 performance: Lazy-load module name strings 2019-09-20 08:59:34 +01:00
Shamim Rezaie
ea191cf1b4 MDL-41507 core_group: Consistent default value for FEATURE_GROUPS 2018-12-12 14:03:45 +11:00
Marina Glancy
8852faea91 MDL-61876 modules: cm_info::set_content can accept formatted text
Allow modules to apply format_text() on user input before calling cm_info::set_content(). This is useful for
modules that add interactive content (for example, JS enhanced folder tree). Otherwise all javascript would
be removed if $CFG->forceclean is enabled.
2018-05-07 11:27:56 +08:00
Andrew Nicols
ada9d0fb69 MDL-61305 modinfo: Add back missing require for course 2018-02-12 10:39:51 +08:00
sam marshall
08ec1b4e47 MDL-61305 Performance: Modinfo cache can get built in parallel
In a busy site it is possible that one user will access the site
while another is building modinfo cache. This can result in the
cache being built several times at once, potentially causing a
performance issue.
2018-02-08 14:45:55 +00:00
Jakob
6a36b8526e MDL-37765 course: Add capability to ignore availability restrictions.
Allow a role to view activities without addressing the restriction rules.
2017-03-27 08:37:27 -07:00
Damyon Wiese
663640f5b3 MDL-40759 icons: convert uses of pix_url to pix_icon
Also change filepicker to use scaled svgs instead of sets of custom pngs. The svgs are taken from font-awesome.
2017-03-17 15:52:17 +08:00
Marina Glancy
8341055eb4 MDL-4782 course: Allow activities in the "stealth" mode
Add field 'visibleoncoursepage' to the course_modules table
Add site-wide setting for turning on stealth mode availability
Add callback for "stealth" mode support in the course formats
Change display of modules/sections availability on the course page
2017-02-14 16:38:05 +08:00
Jake Dallimore
048f909b07 MDL-54751 core: introduce deletion flag for course modules
Created a flag, 'deletioninprogress' on the course_modules table to be
used when deleting course modules and course sections. Modified
modinfolib caches such that, when rebuilt, these caches hide the
relevant modules based on the value of the flag.
2016-11-07 07:41:59 +08:00
Jun Pataleta
7a07d34db8 MDL-54988 core: Final deprecation for lib/modinfolib methods
Final deprecation of the following methods:
- course_modinfo::build_section_cache()
- cm_info::get_deprecated_group_members_only()
- cm_info::is_user_access_restricted_by_group()

Plus throw coding exception for direct calls of the following:
- cm_info::get_url()
- cm_info::get_content()
- cm_info::get_extra_classes()
- cm_info::get_on_click()
- cm_info::get_custom_data()
- cm_info::get_after_link()
- cm_info::get_after_edit_icons()
- cm_info::obtain_dynamic_data()
2016-07-26 00:07:25 +08:00
Russell Smith
c1518631e3 MDL-52945 modinfo: Avoid uservisible when module already used. 2016-03-03 16:03:19 +11:00
Dan Poltawski
949c27a026 MDL-27840 course: prevent warnings on half-uninstall mod 2015-12-30 14:12:54 +00:00
Marina Glancy
278b8d18a2 MDL-50892 mod: allow activity to have name '0' 2015-09-11 10:51:52 +08:00
Ankit Agarwal
4d851042eb MDL-44985 libraries: Final deprecation of conditional apis in modinfo 2014-12-10 12:20:37 +05:30
Ankit Agarwal
e56e8e3a0e MDL-44985 libraries: Final deprecation of conditional classes and apis 2014-12-10 12:20:37 +05:30
Mark Nelson
c62ba9b8ca MDL-47735 core: prevented iteration of 'groupmembersonly'
The course module variable 'groupmembersonly' was removed in 2.8.
2014-10-17 18:23:35 -07:00
Julien Boulen
0556eaa9b0 MDL-46984 core_course: added grouping name for activities with no link 2014-10-03 13:10:01 -07:00
Dan Poltawski
4bcf64b053 Merge branch 'MDL-47240-master' of https://github.com/sammarshallou/moodle 2014-09-23 10:57:00 +01:00
sam marshall
eedf5a5a1c MDL-47240 Modinfo: Section info accesses nonexisting property groupingid
This code wasn't actually used, so we should remove it.
2014-09-18 16:38:22 +01:00
Marina Glancy
daad1b4b97 MDL-46937 modinfo: Allow course format to overwrite section availability 2014-09-18 16:18:22 +08:00