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

Wiki Comments HTML Editor Broken

    Details

    • Database:
      Any
    • Testing Instructions:
      Hide

      Note: You need firebug/ developer tool for checking JS errors.

      1. Log in as Admin and turn editing on
      2. Select a course and add a wiki activity
      3. Select wiki activity and add a new Creole format page
      4. Click on comments tab and then click on add comment
      5. Open error console to check for javascript errors
      6. Type text and select/highlight text in comment box
      7. click on bold icon and you should not see any javascript error. Also ** should be suffixed and prefixed to selected text.

      Repeat above steps for NWIKI page format as well.

      Note that because of MDL-28101 Bold and Italics fail in a different way for NWIKI.

      Show
      Note: You need firebug/ developer tool for checking JS errors. Log in as Admin and turn editing on Select a course and add a wiki activity Select wiki activity and add a new Creole format page Click on comments tab and then click on add comment Open error console to check for javascript errors Type text and select/highlight text in comment box click on bold icon and you should not see any javascript error. Also ** should be suffixed and prefixed to selected text. Repeat above steps for NWIKI page format as well. Note that because of MDL-28101 Bold and Italics fail in a different way for NWIKI.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-25883-master

      Description

      The HTML editor for wiki comments doesn't work. If you highlight text and click on any of the editor buttons, nothing happens.
      It produces the following javascript error: document.forms.mform1 is undefined
      Source File: http://moodle2.clamp-it.org/lib/javascript.php?file=%2Fmod%2Fwiki%2Feditors%2Fwiki%2Fbuttons.js&rev=160
      Line: 2

      The form ID is "wikiform" but the script references the id "mform1".

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              cfulton Charles Fulton added a comment -

              I've reproduced this leaving a comment for both Creole and NWiki pages; HTML appears to be fine.

              Show
              cfulton Charles Fulton added a comment - I've reproduced this leaving a comment for both Creole and NWiki pages; HTML appears to be fine.
              Hide
              cfulton Charles Fulton added a comment -

              This appears to be an outdated reference in wiki_editor.php. I've posted what ought to be a quick fix with no downstream effects.

              Show
              cfulton Charles Fulton added a comment - This appears to be an outdated reference in wiki_editor.php. I've posted what ought to be a quick fix with no downstream effects.
              Hide
              cfulton Charles Fulton added a comment -

              This is still broken in 2.1 and is a blocker for MDL-28101. Patch here: https://github.com/mackensen/moodle/compare/master...mdl-25883.

              Show
              cfulton Charles Fulton added a comment - This is still broken in 2.1 and is a blocker for MDL-28101 . Patch here: https://github.com/mackensen/moodle/compare/master...mdl-25883 .
              Hide
              cfulton Charles Fulton added a comment -

              This is still broken in all versions of 2.

              Show
              cfulton Charles Fulton added a comment - This is still broken in all versions of 2.
              Hide
              rajeshtaneja Rajesh Taneja added a comment - - edited

              Thanks for spot-on patch Charles

              Pushing it through process.

              Show
              rajeshtaneja Rajesh Taneja added a comment - - edited Thanks for spot-on patch Charles Pushing it through process.
              Hide
              rajeshtaneja Rajesh Taneja added a comment -

              FYI:
              Javascript is trying to find textarea with id=mform1 /mod/wiki/editors/wiki/buttons.js - Line 23, but while creating wiki editor (/mod/wiki/editors/wiki_editor.php - line 77) we assign id = wikiform.

              Well spotted by Jason

              Show
              rajeshtaneja Rajesh Taneja added a comment - FYI: Javascript is trying to find textarea with id=mform1 /mod/wiki/editors/wiki/buttons.js - Line 23, but while creating wiki editor (/mod/wiki/editors/wiki_editor.php - line 77) we assign id = wikiform. Well spotted by Jason
              Hide
              ankit_frenz Ankit Agarwal added a comment -

              Looks good to me!
              Thanks

              Show
              ankit_frenz Ankit Agarwal added a comment - Looks good to me! Thanks
              Hide
              samhemelryk Sam Hemelryk added a comment -

              Thanks guys, this has been integrated now.
              I was in two minds about it to begin with as wikiform is a much better id in this case then mform1, however given the impending wiki change I think there is no harm in this.

              Cheers
              Sam

              Show
              samhemelryk Sam Hemelryk added a comment - Thanks guys, this has been integrated now. I was in two minds about it to begin with as wikiform is a much better id in this case then mform1, however given the impending wiki change I think there is no harm in this. Cheers Sam
              Hide
              rajeshtaneja Rajesh Taneja added a comment -

              I thought the same Sam, but looking at wikieditor (form element) implementation, I changed my mind

              Show
              rajeshtaneja Rajesh Taneja added a comment - I thought the same Sam, but looking at wikieditor (form element) implementation, I changed my mind
              Hide
              blepoxp Glenn Ansley added a comment -

              Looks good. I tested in master, 2.2, 2.1, and 2.0 integration branches. I will note that the NWiki page type still throws an error but this is being handled in another ticket according to the testing instructions.

              Show
              blepoxp Glenn Ansley added a comment - Looks good. I tested in master, 2.2, 2.1, and 2.0 integration branches. I will note that the NWiki page type still throws an error but this is being handled in another ticket according to the testing instructions.
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              It is late here and I'm very tired but I didn't want to go to sleep before expressing my admiration for your amazing collaboration. Thanks!

              Closing as fixed, heading to zzzZZZzzz, niao

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - It is late here and I'm very tired but I didn't want to go to sleep before expressing my admiration for your amazing collaboration. Thanks! Closing as fixed, heading to zzzZZZzzz, niao

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/Mar/12