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

    • Icon: Sub-task Sub-task
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • None
    • 2.0
    • General
    • None
    • MOODLE_20_STABLE

      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

            skodak Petr Skoda
            ppichet Pierre Pichet (Inactive)
            Andrew Davis Andrew Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.