Moodle
  1. Moodle
  2. MDL-24479

Invalid getstring() in rate_ajax.php

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Ratings
    • Labels:
      None
    • Environment:
      Windows Server 2003
      Apache 2.0.58
      PHP 5.2.10
    • Database:
      Any
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      32169

      Description

      The get_string() calls in rate.php and rate_ajax.php refer to ratings (plural) not rating (singular). This results in the following error when you do not have permission to rate an item:

      JSON.parse <div class="notifytiny">Invalid get_string() identifier: 'ratepermissiondenied' or component 'ratings'<ul style="text-align: left"><li>line 5974 of \lib\moodlelib.php: call to debugging()</li><li>line 6529 of \lib\moodlelib.php: call to core_string_manager->get_string()</li><li>line 81 of \rating\rate_ajax.php: call to get_string()</li></ul></div>

      {"error":"[[ratepermissiondenied]]"}

        Activity

        Hide
        Jenny Gray added a comment -

        The attached patch has been created as part of the OU developers "moodle monday".

        I think it resolves the issue discussed, but I haven't tested it. This is because I'm not entirely sure how you manage to call rate.php or rate_ajax.php if you don't have permission to do so, because its so hard to get the POST form data correct!

        Show
        Jenny Gray added a comment - The attached patch has been created as part of the OU developers "moodle monday". I think it resolves the issue discussed, but I haven't tested it. This is because I'm not entirely sure how you manage to call rate.php or rate_ajax.php if you don't have permission to do so, because its so hard to get the POST form data correct!
        Hide
        Petr Škoda added a comment -

        Patch committed, thanks a lot for both the report and patch.

        Ciao

        Show
        Petr Škoda added a comment - Patch committed, thanks a lot for both the report and patch. Ciao

          People

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

            Dates

            • Created:
              Updated:
              Resolved: