Skip to content
GitLab
Menu
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
0448dbe7
Commit
0448dbe7
authored
Aug 31, 2015
by
David Monllaó
Browse files
Merge branch 'MDL-51131-28' of
git://github.com/marinaglancy/moodle
into MOODLE_28_STABLE
parents
15737f3d
66c0fccb
Changes
2
Hide whitespace changes
Inline
Side-by-side
tag/coursetagslib.php
View file @
0448dbe7
...
...
@@ -315,14 +315,16 @@ function coursetag_get_tagged_courses($tagid) {
function
coursetag_delete_course_tags
(
$courseid
,
$showfeedback
=
false
)
{
global
$DB
,
$OUTPUT
;
if
(
$taginstances
=
$DB
->
get_
fiel
dset_select
(
'tag_instance'
,
'tagid'
,
"itemtype = 'course' AND itemid = :courseid"
,
array
(
'courseid'
=>
$courseid
)))
{
if
(
$taginstances
=
$DB
->
get_
recor
dset_select
(
'tag_instance'
,
"itemtype = 'course' AND itemid = :courseid"
,
array
(
'courseid'
=>
$courseid
)
,
''
,
'tagid, tiuserid'
))
{
tag_delete
(
array_values
(
$taginstances
));
foreach
(
$taginstances
as
$record
)
{
tag_delete_instance
(
'course'
,
$courseid
,
$record
->
tagid
,
$record
->
tiuserid
);
}
$taginstances
->
close
();
}
if
(
$showfeedback
)
{
echo
$OUTPUT
->
notification
(
get_string
(
'deletedcoursetags'
,
'tag'
),
'notifysuccess'
);
}
}
tag/tests/events_test.php
View file @
0448dbe7
...
...
@@ -452,7 +452,7 @@ class core_tag_events_testcase extends advanced_testcase {
$sink
=
$this
->
redirectEvents
();
coursetag_delete_course_tags
(
$course
->
id
);
$events
=
$sink
->
get_events
();
$events
=
array
(
$events
[
2
],
$events
[
3
]);
$events
=
array
(
$events
[
1
],
$events
[
3
]);
// Check that the tags were deleted and the events data is valid.
$this
->
assertEquals
(
0
,
$DB
->
count_records
(
'tag'
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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