-
Bug
-
Resolution: Fixed
-
Minor
-
4.3
If you set up an availability condition ('Restrict access') on an item, this sometimes displays a 'Show more' link. There are 2 conditions for the 'Show more' link to appear:
- If there are multiple conditions
- If the single condition has long text
However, there is a situation in which the 'Show more' link appears, but when you click it, no additional text is revealed. To reproduce:
- Create a Page called 'Test page for completion', which has completion enabled (e.g. student must view the page to complete it).
- Create a second Page; in the 'Restrict access' section, add a restriction based on completion - student must complete the first page.
Now the course page will show
Not available unless: The activity Test page for completion is marked complete ... (Show more)
But if you click 'Show more', this changes to:
Not available unless: The activity Test page for completion is marked complete (Show less)
In other words it actually shows less (the ellipsis goes away) when you click 'Show more'.
This bug occurs because the code in course/format/classes/output/local/content/section/availability.php line 212 uses html_to_text to decide if the text is too long. For the completion condition, the text includes a link, and html_to_text includes this at the end of the text, like (example from a local custom plugin but it's the same principle):
The activity NEW SUBPAGE [1] is available (hidden otherwise)
|
Links:
|
------
|
[1] http://localhost/ou-moodle2/mod/oustudyplansubpage/view.php?id=12
|