Affects Version/s: 3.5.8, 3.7.2, 3.8.4, 3.9.1, 3.10
Affected Branches:MOODLE_310_STABLE, MOODLE_35_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
Fixed Branches:MOODLE_38_STABLE, MOODLE_39_STABLE
Pull from Repository:
Pull 3.9 Branch:
Pull Master Branch:
Pull Master Diff URL:
Login as admin Navigate to Courses > Manage courses and categories in site administration Press Create a new category In the Description field, switch to HTML mode and paste the following: <p><img src="https://moodle.org/pix/moodlelogo.png" width="460" onmouseover="this.src='https://moodle.org/pix/moodlelogo_grayhat.png';" onmouseout="this.src='https://moodle.org/pix/moodlelogo.png';" /></p> Press Create category Back on the Course and category management , click the Actions menu for your new category Press Edit Confirm the content of the Description field has not been cleaned (it should be the same as previously entered)
- Login as admin
- Navigate to Courses > Manage courses and categories in site administration
- Press Create a new category
- In the Description field, switch to HTML mode and paste the following:
- Press Create category
- Back on the Course and category management, click the Actions menu for your new category
- Press Edit
- Confirm the content of the Description field has not been cleaned (it should be the same as previously entered)
I've found this happens on two distinctly different Moodle sites (A highly populated 3.5.8 instance and a near bare bones 3.7.2 instance) so it doesn't seem to be an issue particular to the environment.
Steps to recreate:
- Make sure TinyMCE is your preferred/only active editor.
- Go to YourMoodleSite/course/index.php?category and pick any category, add one if necessary
- Choose "Edit this category" in the administration area
- In the Description box add an image with the "Insert/edit image" button in the "General" section.
- In the same "Insert/edit image" box click the "Advanced tab" and tick "alternative image".
- Add images to "For mouse over" and/or "for mouse out" options.
- Click "Insert"
- Click "Save changes".
- Check the category now has the image in the description functioning with the "mouse over" and "mouse out" working as expected.
- Choose "Edit this category" again.
- Click the image you added so it's highlighted and choose "Insert/edit image" once again
- Go to "Advanced" and observe the alternate images are gone.
- Save changes and you should find the alternate image functionality has indeed stopped working.
If this is confirmed to be happening for others I imagine this can be particularly problematic for where admins have multiple images and are making use of the alternate image functionality, since to work around this any changes made to the description would need to be made with adding the images again.
Note that at step 10 you can also opt to check the HTML, where you can observe the alternate image code has gone away. You will also find going to this and immediately saving changes also has the image being lost, so it appears to be the settings that are loaded at the point of yourmoodlesite/course/editcategory.php?id=x do not contain the alternate image data or HTML. If you open the edit category settings area but don't save however there is no issue, so it seems to be particular to the editing page itself not loading everything, then saving the settings with missing content.
If I've missed anything or if you need any more information do let me know!