Tooltip text on restricted activities includes HTML formatting info

Issue #29 resolved
Donald Hanley created an issue

Hovering over the Restricted tag on a course activity which has restricted access enabled shows the HTML formatting info in addition to the actual restriction text:

I would have expected the tooltip to simply read “Not available unless: …”

Note that I’ve used some custom CSS to modify the appearance of the tiles in this image; however, reverting back to the normal CSS still shows the same behavior.

Comments (7)

  1. Donald Hanley reporter

    I’m using version 3.7.0.16 of the plugin on Moodle 3.8 with the standard Boost theme.

  2. Donald Hanley reporter

    Note: after some experimentation, it seems this problem only occurs on activity tiles when not in edit mode. The section tile tooltip is working fine and the activity tile tooltip displays correctly in edit mode.

  3. Donald Hanley reporter

    One more data point on this issue: if the restricted activity is in Section 0 (using subtiles), the popup is formatted correctly. The formatting problem only happens is (1) it’s an activity subtile, (2) it’s in a section other than Section 0, and (3) editing is turned off. I’ve dug through the plugin code and templates and I can’t for the life of me figure out why this isn’t working as expected.

  4. David Watson repo owner

    Hi Don I am unable to replicate this but I do notice that your sub-tiles are thinner than standard. Has there been some modification?

    If you inspect the element for the restricted tag, do you see data-html=”true” in there?

    Here is an example from my environment with data-html="true"

    <div class="availabilityinfo isrestricted isfullinfo">
        <span class="tag tag-info" title="" data-html="true" data-toggle="tooltip" data-original-title="<div class=&quot;availabilityinfo isrestricted isfullinfo&quot;>
        <span class=&quot;badge badge-info&quot;>Restricted</span> Not available unless: The activity <strong><a href=&quot;http://localhost/moodle39/mod/resource/view.php?id=5&quot;>Test 1</a></strong> is marked complete
    </div>">Restricted</span>
    </div>
    

  5. Donald Hanley reporter

    David, thanks for taking a look. I have been making some custom format changes to the tiles to suit our purposes, resizing and shifting a few things around on the tile, but nothing that should have affected the tag tooltip. Here’s what I have in my availability_info.mustache file:

    <div class="availabilityinfo isrestricted isfullinfo">
        <span class="tag tag-info"{{#visible}}
            {{#availabilitymessage}}title="{{availabilitymessage}}" data-html="true" data-toggle="tooltip"{{/availabilitymessage}}
        {{/visible}}>{{^visible}}{{#str}}hiddenfromstudents{{/str}}{{/visible}}{{#visible}}{{#str}}restricted{{/str}}{{/visible}}</span>
    </div>
    

    I see the data-html=”true” setting there. I don’t happen to have my test system up and running at the moment but I’ll inspect that element in the browser when I have a moment.

    I’m about to reinstall this plugin on a new Moodle installation. I’ll start with the base plugin and make sure everything works as expected and then replace it with my custom updates. If the problem reappears in my version, I’ll accept full responsibility for the error. 😉

    I’ll let you know the results of my tests shortly.

  6. Donald Hanley reporter

    Well, color me confused. I just checked on my test system, where I took the screenshots in the original bug report, and now I can’t reproduce the problem at all. I’m reasonably certain I haven’t made any changes to the code since the last time I looked at this and yet the problem has magically vanished. How very strange (although yet consistent with how the rest of my week has gone so far …).

    Well, since neither of us can reproduce the problem, let’s just close this issue and move on. Thanks!

  7. Log in to comment