Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
1fc64232
Commit
1fc64232
authored
Oct 26, 2017
by
jun
Browse files
Merge branch 'MDL-59909-master' of
git://github.com/damyon/moodle
parents
7f91fb03
a66de3ca
Changes
4
Hide whitespace changes
Inline
Side-by-side
completion/classes/api.php
View file @
1fc64232
...
...
@@ -59,7 +59,10 @@ class api {
if
(
is_object
(
$instanceorid
))
{
$instance
=
$instanceorid
;
}
else
{
$instance
=
$DB
->
get_record
(
$modulename
,
array
(
'id'
=>
$instanceorid
),
'*'
,
MUST_EXIST
);
$instance
=
$DB
->
get_record
(
$modulename
,
array
(
'id'
=>
$instanceorid
),
'*'
,
IGNORE_MISSING
);
}
if
(
!
$instance
)
{
return
false
;
}
$course
=
get_course
(
$instance
->
course
);
...
...
completion/tests/api_test.php
View file @
1fc64232
...
...
@@ -72,6 +72,13 @@ class core_completion_api_testcase extends advanced_testcase {
$this
->
assertEquals
(
\
core_completion\api
::
COMPLETION_EVENT_TYPE_DATE_COMPLETION_EXPECTED
,
$event
->
eventtype
);
$this
->
assertEquals
(
$time
,
$event
->
timestart
);
$this
->
assertEquals
(
$time
,
$event
->
timesort
);
require_once
(
$CFG
->
dirroot
.
'/course/lib.php'
);
// Delete the module.
course_delete_module
(
$assign
->
cmid
);
// Check we don't get a failure when called on a deleted module.
\
core_completion\api
::
update_completion_date_event
(
$assign
->
cmid
,
'assign'
,
null
,
$time
);
}
public
function
test_update_completion_date_event_update
()
{
...
...
course/lib.php
View file @
1fc64232
...
...
@@ -1404,7 +1404,9 @@ function course_module_update_calendar_events($modulename, $instance = null, $cm
if
(
!
isset
(
$cm
))
{
$cm
=
get_coursemodule_from_instance
(
$modulename
,
$instance
->
id
,
$instance
->
course
);
}
course_module_calendar_event_update_process
(
$instance
,
$cm
);
if
(
!
empty
(
$cm
))
{
course_module_calendar_event_update_process
(
$instance
,
$cm
);
}
return
true
;
}
return
false
;
...
...
@@ -1433,8 +1435,9 @@ function course_module_bulk_update_calendar_events($modulename, $courseid = 0) {
}
foreach
(
$instances
as
$instance
)
{
$cm
=
get_coursemodule_from_instance
(
$modulename
,
$instance
->
id
,
$instance
->
course
);
course_module_calendar_event_update_process
(
$instance
,
$cm
);
if
(
$cm
=
get_coursemodule_from_instance
(
$modulename
,
$instance
->
id
,
$instance
->
course
))
{
course_module_calendar_event_update_process
(
$instance
,
$cm
);
}
}
return
true
;
}
...
...
lib/classes/task/refresh_mod_calendar_events_task.php
View file @
1fc64232
...
...
@@ -44,6 +44,10 @@ class refresh_mod_calendar_events_task extends adhoc_task {
* Run the task to refresh calendar events.
*/
public
function
execute
()
{
global
$CFG
;
require_once
(
$CFG
->
dirroot
.
'/course/lib.php'
);
// Specific list of plugins that need to be refreshed. If not set, then all mod plugins will be refreshed.
$pluginstorefresh
=
null
;
if
(
isset
(
$this
->
get_custom_data
()
->
plugins
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment