Affects Version/s: 3.4.7, 3.5.4, 3.6.2
Fix Version/s: None
Component/s: User Tours
Affected Branches:MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
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
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"]'.