|
21 | 21 | * logic, should go here. Never include this file from your lib.php!
|
22 | 22 | *
|
23 | 23 | * @package mod_mediagallery
|
24 |
| - * @copyright NetSpot Pty Ltd |
25 |
| - * @author Adam Olley <adam.olley@netspot.com.au> |
| 24 | + * @copyright Copyright (c) 2021 Open LMS. |
| 25 | + * @author Adam Olley <adam.olley@openlms.net> |
26 | 26 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
27 | 27 | */
|
28 | 28 |
|
@@ -470,7 +470,7 @@ function mod_mediagallery_get_tagged_collections($tag, $exclusivemode = false, $
|
470 | 470 | context_helper::preload_from_record($item);
|
471 | 471 | $modinfo = get_fast_modinfo($item->courseid);
|
472 | 472 | $cm = $modinfo->get_cm($item->cmid);
|
473 |
| - $pageurl = new moodle_url('/mod/mediagallery/view.php', array('g' => $item->id)); |
| 473 | + $pageurl = new moodle_url('/mod/mediagallery/view.php', array('m' => $item->id)); |
474 | 474 | $pagename = format_string($item->name, true, array('context' => context_module::instance($item->cmid)));
|
475 | 475 | $pagename = html_writer::link($pageurl, $pagename);
|
476 | 476 | $courseurl = course_get_url($item->courseid, $cm->sectionnum);
|
@@ -621,7 +621,7 @@ function mod_mediagallery_get_tagged_items($tag, $exclusivemode = false, $fromct
|
621 | 621 |
|
622 | 622 | // Build the SQL query.
|
623 | 623 | $ctxselect = context_helper::get_preload_record_columns_sql('ctx');
|
624 |
| - $query = "SELECT mg.*, mi.id, mi.caption, |
| 624 | + $query = "SELECT mg.*, mg.id as galleryid, mi.id, mi.caption, |
625 | 625 | cm.id AS cmid, c.id AS courseid, c.shortname, c.fullname, $ctxselect
|
626 | 626 | FROM {mediagallery_item} mi
|
627 | 627 | JOIN {mediagallery_gallery} mg ON mg.id = mi.galleryid
|
@@ -691,7 +691,7 @@ function mod_mediagallery_get_tagged_items($tag, $exclusivemode = false, $fromct
|
691 | 691 | context_helper::preload_from_record($item);
|
692 | 692 | $modinfo = get_fast_modinfo($item->courseid);
|
693 | 693 | $cm = $modinfo->get_cm($item->cmid);
|
694 |
| - $pageurl = new moodle_url('/mod/mediagallery/view.php', array('g' => $item->id)); |
| 694 | + $pageurl = new moodle_url('/mod/mediagallery/view.php', array('g' => $item->galleryid)); |
695 | 695 | $pagename = format_string($item->caption, true, array('context' => context_module::instance($item->cmid)));
|
696 | 696 | $pagename = html_writer::link($pageurl, $pagename);
|
697 | 697 | $courseurl = course_get_url($item->courseid, $cm->sectionnum);
|
|
0 commit comments