Moodle
  1. Moodle
  2. MDL-32712

HTML not set to be the default editor in the summary of an assignment after restoring courses from 1.9.14 to 2.2.2

    Details

    • Testing Instructions:
      Hide
      1. As admin/teacher, log into a Moodle 1.9 course
      2. Create a course with an assignment (eg, Online text)
      3. Save the assignment and edit the settings
      4. Note the kind of editor used
      5. Backup the course
      6. Restore the course to a 2.x site and open the course
      7. Edit the settings for the assignment
      8. Note the format of the Description editor

      You should see a TinyMCE editor.

      Show
      As admin/teacher, log into a Moodle 1.9 course Create a course with an assignment (eg, Online text) Save the assignment and edit the settings Note the kind of editor used Backup the course Restore the course to a 2.x site and open the course Edit the settings for the assignment Note the format of the Description editor You should see a TinyMCE editor.
    • Workaround:
      Hide

      Change the format of the restored assignment description to HTML format, save settings, then edit the settings again.

      Show
      Change the format of the restored assignment description to HTML format, save settings, then edit the settings again.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:
    • Rank:
      39666

      Description

      HTML not set to be the default editor in the description of an assignment activity after restoring courses from 1.9.14 to 2.2.2

      Assume this is related to: http://tracker.moodle.org/browse/MDL-29256

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting that. I was able to replicate the problem.

          I've put that on the backlog.

          In the meantime feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.

          Show
          Michael de Raadt added a comment - Thanks for reporting that. I was able to replicate the problem. I've put that on the backlog. In the meantime feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.
          Hide
          Heikki Wilenius added a comment -

          This bug applies also to upgraded installations (from 1.9 to 2.2).

          Show
          Heikki Wilenius added a comment - This bug applies also to upgraded installations (from 1.9 to 2.2).
          Hide
          Charles Fulton added a comment -

          I've started poking at a patch. I think the root problem is that the format field is mostly unused in 1.9, since whether to display the rich-text editor is a user preference. The default value is 0 and it doesn't get touched during the upgrade. I have a partial patch for the upgrade scenario: https://github.com/mackensen/moodle/compare/MOODLE_22_STABLE...MDL-32712-22.

          Show
          Charles Fulton added a comment - I've started poking at a patch. I think the root problem is that the format field is mostly unused in 1.9, since whether to display the rich-text editor is a user preference. The default value is 0 and it doesn't get touched during the upgrade. I have a partial patch for the upgrade scenario: https://github.com/mackensen/moodle/compare/MOODLE_22_STABLE...MDL-32712-22 .
          Hide
          Dean Thayer added a comment -

          I thought I would mention for anyone who has already upgraded all their 2.2 assignments to 2.3 mod_assign assignments without the benefit of Charles' patch that you can correct the situation in bulk by running this SQL on your database:

          update mdl_assign set introformat = 1 where introformat = 0;

          Show
          Dean Thayer added a comment - I thought I would mention for anyone who has already upgraded all their 2.2 assignments to 2.3 mod_assign assignments without the benefit of Charles' patch that you can correct the situation in bulk by running this SQL on your database: update mdl_assign set introformat = 1 where introformat = 0;
          Hide
          Charles Fulton added a comment -

          I'm going to submit the partial patch for review, since the upgrade issue only affects 2.2 and earlier but the backup/restore part also needs to be addressed in 2.3 and 2.4.

          Show
          Charles Fulton added a comment - I'm going to submit the partial patch for review, since the upgrade issue only affects 2.2 and earlier but the backup/restore part also needs to be addressed in 2.3 and 2.4.
          Hide
          Michael de Raadt added a comment -

          David: Could you please peer review this?

          Show
          Michael de Raadt added a comment - David: Could you please peer review this?
          Hide
          Susan Mangan added a comment -

          you guys rock, thanks for fixing this!

          Show
          Susan Mangan added a comment - you guys rock, thanks for fixing this!
          Hide
          David Mudrak added a comment -

          This is tightly related to MDL-34586

          Show
          David Mudrak added a comment - This is tightly related to MDL-34586
          Hide
          David Mudrak added a comment -

          Again, as in MDL-34586, why not to follow the way other modules went? See for example the upgrade step 2009042003 in mod/forum/db/upgrade.php. We can't just set the format field without making sure that the text is converted into real HTML, too. And also, that forum code shows how to consider cases when HTML editor has been disabled site-wide.

          Show
          David Mudrak added a comment - Again, as in MDL-34586 , why not to follow the way other modules went? See for example the upgrade step 2009042003 in mod/forum/db/upgrade.php. We can't just set the format field without making sure that the text is converted into real HTML, too. And also, that forum code shows how to consider cases when HTML editor has been disabled site-wide.
          Hide
          Charles Fulton added a comment -

          Rewritten per MDL-34586.

          Show
          Charles Fulton added a comment - Rewritten per MDL-34586 .
          Hide
          David Mudrak added a comment -

          Yup, looking good now. Thanks for the patch Charles!

          Show
          David Mudrak added a comment - Yup, looking good now. Thanks for the patch Charles!
          Hide
          Charles Fulton added a comment -

          Note: fixed typo on line 159; wrong variable name.

          Show
          Charles Fulton added a comment - Note: fixed typo on line 159; wrong variable name.
          Hide
          Dan Poltawski added a comment -

          Does this need sending to integration?

          Show
          Dan Poltawski added a comment - Does this need sending to integration?
          Hide
          Charles Fulton added a comment -

          @Dan: yep.

          Show
          Charles Fulton added a comment - @Dan: yep.
          Hide
          Dan Poltawski added a comment -

          Sending all 'waiting for peer review' issues to integration before freeze, as agreed in Integrators Meeting 19/10/12. We are doing this to ensure any 'integratable issues' will not got missed before freeze..

          Show
          Dan Poltawski added a comment - Sending all 'waiting for peer review' issues to integration before freeze, as agreed in Integrators Meeting 19/10/12. We are doing this to ensure any 'integratable issues' will not got missed before freeze..
          Hide
          Dan Poltawski added a comment -

          Thanks Charles, integrated to 22 only.

          Show
          Dan Poltawski added a comment - Thanks Charles, integrated to 22 only.
          Hide
          Rajesh Taneja added a comment -

          Sorry Guys,

          I am still seeing moodle auto-format in activity description, after restoring course.

          Steps:

          1. Created a course in 19 with text activity and editor was tinymce
          2. Backed up 19 course and restored in integration 22
          3. Went to activity and click edit settings
          4. Description is moodle auto-format.
          Show
          Rajesh Taneja added a comment - Sorry Guys, I am still seeing moodle auto-format in activity description, after restoring course. Steps: Created a course in 19 with text activity and editor was tinymce Backed up 19 course and restored in integration 22 Went to activity and click edit settings Description is moodle auto-format.
          Hide
          Charles Fulton added a comment -

          @Rajesh, I think I confused the issue along the way but this patch only covers the 1.9-2.2 upgrade scenario (which the testing instructions don't cover). The backup/restore scenario is in MDL-34586, which I think was reviewed and needs to be integrated. I think they're split up because this one is 2.2 only and the other should be in master and below.

          Show
          Charles Fulton added a comment - @Rajesh, I think I confused the issue along the way but this patch only covers the 1.9-2.2 upgrade scenario (which the testing instructions don't cover). The backup/restore scenario is in MDL-34586 , which I think was reviewed and needs to be integrated. I think they're split up because this one is 2.2 only and the other should be in master and below.
          Hide
          Rajesh Taneja added a comment - - edited

          Sorry Charles,

          I didn't look at related issue. Followed test instructions and it didn't work as mentioned.

          Will request Dan to reopen this for testing. I will just update site from 1.9 -> 2.2 and check if I can see TinyMCE.

          Show
          Rajesh Taneja added a comment - - edited Sorry Charles, I didn't look at related issue. Followed test instructions and it didn't work as mentioned. Will request Dan to reopen this for testing. I will just update site from 1.9 -> 2.2 and check if I can see TinyMCE.
          Hide
          Rajesh Taneja added a comment -

          Thanks Charles,

          Patch works great for upgrade from 1.9 -> 2.2.
          Can see TinyMCE in Assignment description.

          Show
          Rajesh Taneja added a comment - Thanks Charles, Patch works great for upgrade from 1.9 -> 2.2. Can see TinyMCE in Assignment description.
          Hide
          Dan Poltawski added a comment -

          Hurray!

          You did it, congratulations! You have on Mojito credit to redeem after the release of Moodle 2.4

          Show
          Dan Poltawski added a comment - Hurray! You did it, congratulations! You have on Mojito credit to redeem after the release of Moodle 2.4

            People

            • Votes:
              12 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: