Skip to content

Commit 1c01a3c

Browse files
authored
Merge pull request #29 from bdecentgmbh/dev
Call it 1.2
2 parents c5d7e21 + 851763e commit 1c01a3c

24 files changed

+213
-45
lines changed

.github/workflows/moodle-ci.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ on: [push, pull_request]
44

55
jobs:
66
test:
7-
runs-on: ubuntu-18.04
7+
runs-on: ubuntu-22.04
88

99
services:
1010
postgres:
11-
image: postgres:12.7
11+
image: postgres:13
1212
env:
1313
POSTGRES_USER: 'postgres'
1414
POSTGRES_HOST_AUTH_METHOD: 'trust'
1515
ports:
1616
- 5432:5432
1717
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
1818
mariadb:
19-
image: mariadb:10.5
19+
image: mariadb:10.6.7
2020
env:
2121
MYSQL_USER: 'root'
2222
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
@@ -28,15 +28,12 @@ jobs:
2828
fail-fast: false
2929
matrix:
3030
include:
31-
- php: '8.0'
32-
moodle-branch: 'master'
31+
- php: '8.3'
32+
moodle-branch: 'MOODLE_405_STABLE'
3333
database: 'pgsql'
34-
- php: '7.4'
35-
moodle-branch: 'master'
34+
- php: '8.2'
35+
moodle-branch: 'MOODLE_405_STABLE'
3636
database: 'mariadb'
37-
- php: '7.4'
38-
moodle-branch: 'master'
39-
database: 'pgsql'
4037

4138
steps:
4239
- name: Check out repository code

classes/plugininfo/ltool.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $h
8282
return;
8383
}
8484

85-
if (!$hassiteconfig or !file_exists($this->full_path('settings.php'))) {
85+
if (!$hassiteconfig || !file_exists($this->full_path('settings.php'))) {
8686
return;
8787
}
8888

lang/en/local_learningtools.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,5 @@
242242
$string['strftimemonthdateyear'] = '%B, %dth %Y';
243243
$string['strftimeyearmonth'] = '%Y/%m/%d';
244244
$string['strftimemonthnamedate'] = '%B %d, %Y';
245+
$string['subplugintype_ltool'] = "Learning Tools";
246+
$string['subplugintype_ltool_plural'] = "ltools";

lib.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function local_learningtools_get_coursemodule_id($record) {
141141
global $DB;
142142

143143
$contextinfo = $DB->get_record('context', array('id' => $record->contextid, 'contextlevel' => $record->contextlevel));
144-
return $contextinfo->instanceid;
144+
return isset($contextinfo->instanceid) ? $contextinfo->instanceid : 0;
145145
}
146146
/**
147147
* Get the courses name.
@@ -221,13 +221,19 @@ function local_learningtools_get_course_categoryname($courseid) {
221221
function local_learningtools_get_module_name($data, $mod = false) {
222222
global $DB;
223223
$coursemoduleinfo = $DB->get_record('course_modules', array('id' => $data->coursemodule));
224+
if (empty($coursemoduleinfo)) {
225+
return "";
226+
}
224227
$moduleinfo = $DB->get_record('modules', array('id' => $coursemoduleinfo->module));
225-
if ($mod) {
226-
return $moduleinfo->name;
228+
if ($moduleinfo) {
229+
if ($mod) {
230+
return $moduleinfo->name;
231+
}
232+
// Get module instance name.
233+
$report = get_coursemodule_from_instance($moduleinfo->name, $coursemoduleinfo->instance, $data->courseid);
234+
return $report->name;
227235
}
228-
// Get module instance name.
229-
$report = get_coursemodule_from_instance($moduleinfo->name, $coursemoduleinfo->instance, $data->courseid);
230-
return $report->name;
236+
return "";
231237
}
232238

233239

ltool/bookmarks/classes/bookmarkstool_filter.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,41 @@
3333
*/
3434
class bookmarkstool_filter {
3535

36+
/**
37+
* @var int
38+
*/
39+
public $userid;
40+
41+
/**
42+
* @var int
43+
*/
44+
public $courseid;
45+
46+
/**
47+
* @var int
48+
*/
49+
public $child;
50+
51+
/**
52+
* @var array
53+
*/
54+
public $urlparams;
55+
56+
/**
57+
* @var int
58+
*/
59+
public $teacher;
60+
61+
/**
62+
* @var string
63+
*/
64+
public $baseurl;
65+
66+
/**
67+
* @var string
68+
*/
69+
public $pageurl;
70+
3671
/**
3772
* Loads bookmarks tools info.
3873
* @param int $userid current userid

ltool/bookmarks/lib.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
defined('MOODLE_INTERNAL') || die();
2727

2828
require_once($CFG->dirroot. '/local/learningtools/lib.php');
29+
2930
/**
3031
* Defines ltool bookmarks nodes for my profile navigation tree.
3132
*

ltool/bookmarks/styles.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
}
8787
.bookmarks-list-info .activity-block .course-element .course-list .right-block {
8888
margin-left: 30px;
89+
justify-content: end;
8990
}
9091
.bookmarks-list-info .activity-block .course-element .course-list .right-block .calendar-block {
9192
margin-right: 30px;
@@ -107,6 +108,7 @@
107108
margin-right: 0;
108109
}
109110
.bookmarks-list-info .activity-block .course-element .course-list .right-block .button-block button {
111+
min-width: 100px;
110112
height: auto;
111113
color: #fff;
112114
font-size: 13px;

ltool/bookmarks/tests/ltool_bookmarks_test.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,26 @@
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
2424
namespace ltool_bookmarks;
25+
2526
/**
2627
* Bookmarks subplugin for learningtools phpunit test cases defined.
28+
* @runTestsInSeparateProcesses
2729
*/
2830
class ltool_bookmarks_test extends \advanced_testcase {
2931

32+
33+
/**
34+
* Summary of context
35+
* @var object
36+
*/
37+
public $page;
38+
39+
/**
40+
* Summary of context
41+
* @var object
42+
*/
43+
public $context;
44+
3045
/**
3146
* Create custom page instance and set admin user as loggedin user.
3247
*
@@ -52,7 +67,8 @@ public function setup(): void {
5267

5368
/**
5469
* Case to test the external method to create/delete bookmarks.
55-
* @covers ::ltool_bookmarks_check_page_bookmarks_exist
70+
* @covers \ltool_bookmarks\external::save_userbookmarks
71+
* @runInSeparateProcess
5672
* @return void
5773
*/
5874
public function test_external_test(): void {

ltool/bookmarks/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
defined('MOODLE_INTERNAL') || die();
2626

2727
$plugin->component = 'ltool_bookmarks';
28-
$plugin->version = 2022022800;
28+
$plugin->version = 2024120300;
2929
$plugin->requires = 2020061501;
3030

3131

ltool/focus/tests/behat/behat_focus.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ public function i_check_focus_mode_enable(): void {
4949
$footerjs = "
5050
return (
5151
Y.one('#page-footer') &&
52-
Y.one('#page-footer').getComputedStyle('display') === 'none'
52+
Y.one('#page-footer').getComputedStyle('display') == 'none'
5353
)
5454
";
55+
5556
if (!$this->evaluate_script($footerjs)) {
5657
throw new ExpectationException("Doesn't enable the focus mode", $this->getSession());
5758
}

0 commit comments

Comments
 (0)