Explorar o código

Improve fix for issue with publication of additional links on course homepage (was using c_tool.id instead of c_tool.iid)

Yannick Warnier %!s(int64=7) %!d(string=hai) anos
pai
achega
2ab7ffa024
Modificáronse 2 ficheiros con 3 adicións e 3 borrados
  1. 1 1
      main/inc/ajax/course_home.ajax.php
  2. 2 2
      main/inc/lib/course_home.lib.php

+ 1 - 1
main/inc/ajax/course_home.ajax.php

@@ -23,7 +23,7 @@ switch ($action) {
             $criteria = [
                 'cId' => $course_id,
                 'sessionId' => 0,
-                'id' => (int) $_GET['id']
+                'iid' => (int) $_GET['id']
             ];
             /** @var CTool $tool */
             $tool = $repository->findOneBy($criteria);

+ 2 - 2
main/inc/lib/course_home.lib.php

@@ -793,7 +793,7 @@ class CourseHome
                                 $link['name'] = Display::return_icon(
                                     'visible.png',
                                     get_lang('Deactivate'),
-                                    array('id' => 'linktool_'.$tool['id']),
+                                    array('id' => 'linktool_'.$tool['iid']),
                                     ICON_SIZE_SMALL,
                                     false
                                 );
@@ -804,7 +804,7 @@ class CourseHome
                                 $link['name'] = Display::return_icon(
                                     'invisible.png',
                                     get_lang('Activate'),
-                                    array('id' => 'linktool_'.$tool['id']),
+                                    array('id' => 'linktool_'.$tool['iid']),
                                     ICON_SIZE_SMALL,
                                     false
                                 );