Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-64740

Invalid CSS in User Tours can cause issues

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.4.7, 3.5.4, 3.6.2
    • Fix Version/s: None
    • Component/s: User Tours
    • Labels:
      None
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE

      Description

      When creating a user tour you can target CSS selectors.

      We had a broken user tour and it turned out to be user error because they'd pasted HTML into this area e.g. instead of using img[alt="alternative text"] they'd pasted in <img src="blah" alt="alternative text"> to try to match that image.

      Now, that's obviously not using the tool correctly, but it would be good if the contents of that got validated on entry so that it's not causing errors later on, it says something like:
      Invalid response value detected
      File: /lib/externallib.php
      Line: 424
      Stack trace:
      tourconfig => Invalid response value detected: steps => Invalid response value detected: element => Invalid response value detected: Invalid external api response: the value is "<img src="blah" alt="alernative text">", the server was expecting "text" typeError code: invalidresponse

      • line 424 of /lib/externallib.php: invalid_response_exception thrown
        When it tries to fetch the step via AJAX and the return value gets validated.

      You can also see the HTML entered displayed as live HTML on the user tours steps screen where it would normall say "A CSS selector matching 'img[alt="alternative text"]'.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            bawjaws David Scotson
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: