Moodle
  1. Moodle
  2. MDL-27625

Regression: cannot delete ratings

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.3
    • Fix Version/s: 2.0.4
    • Component/s: Ratings
    • Database:
      Any
    • Testing Instructions:
      Hide

      Fix is 100% the same for 20_STABLE and master so should be enough to test under 20_STABLE:

      • Create two forums (one with numerical scale and another with custom scale) with some posts.
      • Create two datas (one with numerical scale and another with custom scale) with some records.
      • Create two glossaries (one with numerical scale and another with custom scale) with some entries.
      • Rate 1 post, one record and one entry (at least)
      • TEST: Try to unrate them with JS enabled. No error should happen.
      • TEST: Refresh the page. The unrated values continue unrated.
      • TEST: Try to unrate them with JS disable. No error should happen.
      • TEST: Refresh the page. The unrated values continue unrated.
      Show
      Fix is 100% the same for 20_STABLE and master so should be enough to test under 20_STABLE: Create two forums (one with numerical scale and another with custom scale) with some posts. Create two datas (one with numerical scale and another with custom scale) with some records. Create two glossaries (one with numerical scale and another with custom scale) with some entries. Rate 1 post, one record and one entry (at least) TEST: Try to unrate them with JS enabled. No error should happen. TEST: Refresh the page. The unrated values continue unrated. TEST: Try to unrate them with JS disable. No error should happen. TEST: Refresh the page. The unrated values continue unrated.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-27625_master
    • Rank:
      17302

      Description

      You don't seem to be able to delete a rating. If you select "Rate..." it should delete your rating. I'm getting an error back "Invalid numeric value"

      Its due to this code in the 3 per module rating validation functions.
      if ($params['rating'] < 0)

      { throw new rating_exception('invalidnum'); }

        Issue Links

          Activity

          Hide
          Eloy Lafuente (stronk7) added a comment -

          Raising to critical and adding it to current integration round.

          Show
          Eloy Lafuente (stronk7) added a comment - Raising to critical and adding it to current integration round.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Just done this (master), seems to be working ok here:

          https://github.com/stronk7/moodle/compare/master...MDL-27625_master

          Feel free to cherry-pick it if agree.

          TODO:

          • Backport this to 20_STABLE
          • Submit this for integration
          • Retest MDL-27471

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Just done this (master), seems to be working ok here: https://github.com/stronk7/moodle/compare/master...MDL-27625_master Feel free to cherry-pick it if agree. TODO: Backport this to 20_STABLE Submit this for integration Retest MDL-27471 Ciao
          Show
          Eloy Lafuente (stronk7) added a comment - - edited And 20_STABLE version too: https://github.com/stronk7/moodle/compare/MOODLE_20_STABLE...MDL-27625_20stable
          Hide
          Andrew Davis added a comment -

          code looks good and seems to work as desired

          Show
          Andrew Davis added a comment - code looks good and seems to work as desired
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
          Hide
          Helen Foster added a comment -

          Everything tested fine. The only small, probably unrelated problem I came across was with a database activity, JavaScript disabled, saving rating takes you back to list view not single view.

          Show
          Helen Foster added a comment - Everything tested fine. The only small, probably unrelated problem I came across was with a database activity, JavaScript disabled, saving rating takes you back to list view not single view.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Aha, thanks! Yup I think it's worth creating a different issue for that and passing this, can you plz?

          Show
          Eloy Lafuente (stronk7) added a comment - Aha, thanks! Yup I think it's worth creating a different issue for that and passing this, can you plz?
          Hide
          Helen Foster added a comment -

          Passing as requested

          Show
          Helen Foster added a comment - Passing as requested
          Hide
          Eloy Lafuente (stronk7) added a comment -

          And this is now part of Moodle upstream, many thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - And this is now part of Moodle upstream, many thanks!
          Hide
          Helen Foster added a comment -

          Small problem with rating when JavaScript is disabled reported as MDL-27640.

          Show
          Helen Foster added a comment - Small problem with rating when JavaScript is disabled reported as MDL-27640 .
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Thanks, Helen!

          Show
          Eloy Lafuente (stronk7) added a comment - Thanks, Helen!

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: