Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-14085 META: Cleanup of harcoded error() messages
  3. MDL-14973

print_error does not allow more than one parameter ($a) in the string

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: General
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      Trying to put an error message using qtype_multianswer.php with 2 parameters
      $string['unknownquestiontypeofsubquestion'] = 'Unknown question type: $a->type of question part # $a->sub';
      with the following code
      $a = new stdClass;
      $a->type = 'multichoice' ;
      $a->sub = "1";
      echo "<p>".get_string('unknownquestiontypeofsubquestion', 'qtype_multianswer',$a)."</p>";
      print_error('unknownquestiontypeofsubquestion', 'qtype_multianswer',$a);
      the echo get_string is Ok but the print_error has an error from weblib. see the screenshot to be attached

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            ppichet Pierre Pichet
            Tester:
            Andrew Davis
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: