Uncaught Error: No define call for theme_boost/tooltip

Uncaught Error: No define call for theme_boost/tooltip

by Hartmut Scherer -
Number of replies: 10

Moodle 3.9 (Build: 20200615)

Moodle 3.9 Fordson v3.9 release 1.1


Hello all,

A student informed me that she can no longer expand a collapsed description.

Reading Response - description collapsedI attached the text file

When I logged in using "login in as" I also was not able to expand the description. 

Here is a screenshot of the console error:

console error

I purged all caches, switched themes, and used a different course format but nothing helped.

I highly appreciate any help.

With kind regards,

Hartmut

Average of ratings: Useful (1)
In reply to Hartmut Scherer

Re: Uncaught Error: No define call for theme_boost/tooltip

by Paul Meyers -

I have the same error with Fordson:

Moodle 3.9.3+ (Build: 20201211)


Hope to hear a solution.

In reply to Paul Meyers

Re: Uncaught Error: No define call for theme_boost/tooltip

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Try changing "theme_boost/tooltip" to "theme_boost/bootstrap/tooltip" so that the line:

require(['jquery','theme_boost/tooltip'], function($){$('[data-tooltip="tooltip"]').tooltip()});

becomes:

require(['jquery','theme_boost/bootstrap/tooltip'], function($){$('[data-tooltip="tooltip"]').tooltip()});

in the following files in the theme/fordson/templates folder:

  1. columns2.mustache on line 128;
  2. frontpage.mustache on line 154;
  3. mydashboard.mustache on line 124.

Then purge all caches and see if the problem still occurs.

Average of ratings: Useful (5)
In reply to Leon Stringer

Re: Uncaught Error: No define call for theme_boost/tooltip

by Paul Meyers -
Leon,

I made your recommended changes to my site and the error is no longer shown in the console. I did not verify the OP problem with the collapsed description functionality.

Thanks for the help!
In reply to Leon Stringer

Re: Uncaught Error: No define call for theme_boost/tooltip

by Hartmut Scherer -
Leon,

Thank you for sharing what needed to change in the Fordson theme. The error in the console is gone but users with a student role can still not expand or collapse the tooltip, only users with a teacher role or higher can do this. Anyhow, I highly appreciate your post.

With kind regards,
Hartmut
In reply to Hartmut Scherer

Re: Uncaught Error: No define call for theme_boost/tooltip

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Harmut: Can you explain the steps needed to show the collapsed description as it appears in your screenshot? I'm not familiar with it, is it a particular activity with a setting? Or a specific course format? Or a Fordson setting?

In reply to Leon Stringer

Re: Uncaught Error: No define call for theme_boost/tooltip

by Hartmut Scherer -
Hi Leon,

I will try my best to answer your question. At least a year ago I started using the following lines in the description of all activities, in labels and URLs. Here is an example of an assignment:
Plain text of description_

The expanded description would look like this:
expanded description_
On the main course page on Moodle, students would initially only see the collapsed text, which is just one line. 
main course page

When students pressed on "Click to view more details" they saw the entire description and could read it without "opening" the assignment. They stayed on the main class page. I only tried it out in the Fordson theme but I am pretty sure that this is possible in any theme. It doesn't require a specific theme or course format.

With kind regards,
Hartmut
In reply to Hartmut Scherer

Re: Uncaught Error: No define call for theme_boost/tooltip

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Hartmut,

Thank you for the clear explanation. I have tried this on Moodle 3.9 (Build: 20200615) with Fordson 2020061800 and it worked on my site, before and after:

Screenshot showing collapsed label contentScreenshot showing expanded label content.

Ignore the 'ex' at the start, I didn't fix the expanded/collapsed SVG icon.

One thing I did notice is that I had to wait for the page to load completely before the expand/collapse links would work.

I would suggest creating a new test course with one label to see if this works. This should show whether there's a problem with a specific course or label.

I recommend installing minor version updates for 3.9 although I can't see that it would help with this issue. I tried the expand/collapse labels with Moodle 3.9.4+ (Build: 20210204) and it still worked.

In reply to Leon Stringer

Re: Uncaught Error: No define call for theme_boost/tooltip

by Hartmut Scherer -
Leon,

I can confirm that "Click to view more details" works fine for the teacher role as well as the student role. Thank you for all your help and patience.

With kind regards,
Hartmut
In reply to Hartmut Scherer

Re: Uncaught Error: No define call for theme_boost/tooltip

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

That's not 'tooltip' but 'collapse' -> https://getbootstrap.com/docs/4.0/components/collapse/. Looking at your sample code, the value of 'aria-controls' is the wrong id. Thus look at the Bootstrap example and improve things. You'll need to ensure that the id is unique for each one.  Also why is 'span' an attribute of the 'a' tag?

G
In reply to Gareth J Barnard

Re: Uncaught Error: No define call for theme_boost/tooltip

by Hartmut Scherer -
Dear Gareth,

Thank you for the reference to 'collapse.' I adopted the code and it works for students and teachers. The subject line has to do with the console error that I mentioned in my first post which no longer occurs after I updated the three lines in Fordson as recommended by Leon.

With kind regards,
Hartmut