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

"Alternate image" gets removed upon editing course category settings.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.8, 3.7.2, 3.8.4, 3.9.1, 3.10
    • Fix Version/s: 3.8.5, 3.9.2
    • Component/s: Course
    • Testing Instructions:
      Hide
      1. Login as admin
      2. Navigate to Courses > Manage courses and categories in site administration
      3. Press Create a new category
      4. 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>
        

      5. Press Create category
      6. Back on the Course and category management, click the Actions menu for your new category
      7. Press Edit
      8. Confirm the content of the Description field has not been cleaned (it should be the same as previously entered)
      Show
      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)
    • 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 3.8 Branch:
    • Pull 3.9 Branch:
    • Pull Master Branch:

      Description

      Hi there,

       

      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:

      1. Make sure TinyMCE is your preferred/only active editor.
      2. Go to YourMoodleSite/course/index.php?category and pick any category, add one if necessary
      3. Choose "Edit this category" in the administration area
      4. In the Description box add an image with the "Insert/edit image" button in the "General" section.
      5. In the same "Insert/edit image" box click the "Advanced tab" and tick "alternative image".
      6. Add images to "For mouse over" and/or "for mouse out" options.
      7. Click "Insert"
      8.  Click "Save changes".
      9. Check the category now has the image in the description functioning with the "mouse over" and "mouse out" working as expected.
      10.  Choose "Edit this category" again.
      11. Click the image you added so it's highlighted and choose "Insert/edit image" once again
      12. Go to "Advanced" and observe the alternate images are gone.
      13. 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!

        Attachments

          Activity

            People

            Assignee:
            pholden Paul Holden
            Reporter:
            sgodbehere Samuel Godbehere
            Peer reviewer:
            Michael Hawkins
            Integrator:
            Andrew Nicols
            Tester:
            Anna Carissa Sadia
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Sep/20

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 15 minutes
                2h 15m