Closed lninic closed 5 years ago
I noticed the same, I don't know if the fix is right (I don't use nested tabs or anything fancy) but i just removed the [0] :
diff --git a/renderer.php b/renderer.php
index 6a5e631..854dde8 100644
--- a/renderer.php
+++ b/renderer.php
@@ -392,7 +392,7 @@ class format_onetopic_renderer extends format_section_renderer_base {
$sectionnavlinks = $this->get_nav_links($course, $sections, $displaysection);
$sectiontitle = '';
- if (!$course->hidetabsbar && count($tabs[0]) > 0) {
+ if (!$course->hidetabsbar && $tabs && count($tabs) > 0) {
if ($PAGE->user_is_editing() && has_capability('moodle/course:update', $context)) {
Yes... the solution is very simple. I fix it in branch "MOODLE_33_select_visible_tab_by_default ", into the commit: https://github.com/davidherney/moodle-format_onetopic/commit/f9d3857f485c73f0342b1393a55dd7bd74a8fd79
I waiting for testers in order to merge it with the master branch.
Moodle version: Moodle 3.5.2+ (Build: 20180914) PHP version : PHP 7.2.11 Onetopic version: san juan 2018010604
This warning appears when editing course above tabs:
Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/moodle/course/format/onetopic/renderer.php on line 395
This is the 395 line:
It seem count($tabs) is not an array so the latest PHP 7.2 shows a warning there, please check the changes here: http://php.net/manual/en/migration72.incompatible.php http://php.net/manual/en/function.count.php#refsect1-function.count-changelog
Is there any way to fix this error?