Missing language strings in Fordson Collapsible Topics?

Missing language strings in Fordson Collapsible Topics?

by Steven A -
Number of replies: 6
My setup is Moodle 3.8, Fordson theme, integration turned on for the Collapsible Topics Course Format in Fordson presets.

Initially in a course, the string for Expand all is fine, and it does expand all topics, but then the language string changes to [collapseall,moodle]. It then toggles back and forth between [collapseall,moodle] and [expandall,moodle]. It works, but the language strings are missing. I've tried to locate the source of the problem, but have been unsuccessful. Any ideas how I might fix this?
Average of ratings: -
In reply to Steven A

Re: Missing language strings in Fordson Collapsible Topics?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, usual question before I can help you (please read the forum rules!)... What version of the theme and Collapsed Topics are you using please?

How can I replicate this, what setting values have you set from the defaults?  Any code changes?

In reply to Gareth J Barnard

Re: Missing language strings in Fordson Collapsible Topics?

by Steven A -
Thanks, Gareth. Site administration > Plugins > Plugins overview has the following information:
Fordson: Moodle 3.8 Fordson v3.8 release 1.2
Collapsible Topics format: 3.8 2019111700

To replicate, go into the Fordson theme, Presets tab, find Collapsible Topics Course Format, and Turn integration on. Then go into a course, Edit course settings, and change the Course format to Collapsible Topics format. There are two other settings (Hidden sections, Section progress bar). Neither have any effect on the language strings. There's also a setting in the Collapsible Topics format itself called Keep collapse state over session. Toggling it on and off has no effect.

Edit..
While fiddling around with this more, I notice two things. One, with editing turned on, the language strings behave as expected, but not when editing is turned off. Two, if there's content in Topic 0, the language strings behave as expected, but not if there's no Topic 0. This might be the issue! For example when creating a new course, I set "Number of announcements" (Edit course settings > Appearance) to "0". With Number of announcements set to "0" during course creation, Topic 0 doesn't show up at all, and neither do the language strings. But with content in Topic 0, all is good. It seems Collapsible Topics needs a Topic 0. I'd like to use this plugin but not have a Topic 0.
In reply to Steven A

Re: Missing language strings in Fordson Collapsible Topics?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, can replicate, in 'print_multiple_section_page' for the file 'format_collapsibletopics_renderer.php' then given the scenario with no content in section 0 and the code being:

            if ($section == 0) {
                echo '<div class="collapsible-actions" >
    <a href="#" class="expandall" role="button">' . get_string('expandall') . '
    </a>
</div>';
                // 0-section is displayed a little different then the others.
                if ($thissection->summary or !empty($modinfo->sections[0]) or $PAGE->user_is_editing()) {
                    $this->page->requires->strings_for_js(array('collapseall', 'expandall'), 'moodle');
                    $modules = $this->courserenderer->course_section_cm_list($course, $thissection, 0);
                    echo $this->section_header($thissection, $course, false, 0);
                    echo $modules;
                    
                    echo $this->section_footer();
                   } 
                continue;
            }

then:

$this->page->requires->strings_for_js(array('collapseall', 'expandall'), 'moodle');

is in the wrong place.  This is a bug with the theme and not the course format, which seems fine.  Up to Chris to fix.

I'm also getting:

Notice:  Trying to get property 'cm' of non-object in F:\moodledev\moodle38\theme\fordson\lib\fordson_lib.php on line 133

When viewing the page, which I think is another bug.

G

In reply to Gareth J Barnard

Re: Missing language strings in Fordson Collapsible Topics?

by Steven A -

Thanks, Gareth! I can confirm Collapsible Topics works fine on its own (integration turned off). I'm not sure about the other notice or if I'll be able to suggest fixes for either, but I'll fiddle around and hope for an update in the mean time.

In reply to Steven A

Re: Missing language strings in Fordson Collapsible Topics?

by Acqua Alta -
Hi Steven,
Maybe you should open an issue for this, with the information that Gareth supplied. Here is the plugin github:
https://github.com/dbnschools/moodle-theme_fordson/issues