Moodle
  1. Moodle
  2. MDL-14085 META: Cleanup of harcoded error() messages
  3. MDL-14128

Move all current uses of error(get_string('xxxx')) to a proper use of print_error() 1.9 and HEAD

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9.1
    • Component/s: General
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      37061

      Activity

      Hide
      Eloy Lafuente (stronk7) added a comment -

      Hi Cai, two comments about the tracker:

      1) We use to put only one release for each branch both in the "affects versions" and "fix versions". So I guess the correct ones for this should be:

      affects versions: 1.9, 2.0 (HEAD)
      fix versions: 1.9.1, 2.0 (HEAD)

      But, generally, for something fixed in a branch (1.9) we don't use to include HEAD (2.0). It's supposed that we always merge changes there, so finally I'd leave this as:

      affects versions: 1.9
      fix versions: 1.9.1

      And will use the 2.0 for things coming exclusively in 2.0.

      Just an explanation. Ciao

      P.S.: Of course, once you have resolved one bug you should mark it as resolved (fixed) to allow it to be reviewed on weekly reviews.

      Show
      Eloy Lafuente (stronk7) added a comment - Hi Cai, two comments about the tracker: 1) We use to put only one release for each branch both in the "affects versions" and "fix versions". So I guess the correct ones for this should be: affects versions: 1.9, 2.0 (HEAD) fix versions: 1.9.1, 2.0 (HEAD) But, generally, for something fixed in a branch (1.9) we don't use to include HEAD (2.0). It's supposed that we always merge changes there, so finally I'd leave this as: affects versions: 1.9 fix versions: 1.9.1 And will use the 2.0 for things coming exclusively in 2.0. Just an explanation. Ciao P.S.: Of course, once you have resolved one bug you should mark it as resolved (fixed) to allow it to be reviewed on weekly reviews.
      Hide
      Dongsheng Cai added a comment -

      Thanks Eloy

      Show
      Dongsheng Cai added a comment - Thanks Eloy
      Hide
      Petr Škoda added a comment - - edited

      regressions - please fix before end of Teasday review:
      1/

      • error(get_string("invalidpubkey", 'mnet') . $errmsg ,'peers.php?step=update&hostid='.$mnet_peer->id);
        + //error(get_string("invalidpubkey", 'mnet') . $errmsg ,'peers.php?step=update&hostid='.$mnet_peer->id);
        + print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id, $errmsg);

      2/

      • error(get_string('noguestpost', 'forum').
      • ' You are not allowed to make modifications to this RSS feed at this time.',
      • $referrer);

      + //print_error(get_string('noguestpost', 'forum').
      + // ' You are not allowed to make modifications to this RSS feed at this time.',
      + // $referrer);
      + print_error('noguestpost', 'forum', $referrer, 'You are not allowed to make modifications to this RSS feed at this time.');

      }

      3/

      • error(get_string('noguestpost', 'forum').
      • ' You are not allowed to make modifications to this RSS feed at this time.',
      • $referrer);

      + //print_error(get_string('noguestpost', 'forum').
      + // ' You are not allowed to make modifications to this RSS feed at this time.',
      + // $referrer);
      + print_error('noguestpost', 'forum', $referrer, 'You are not allowed to make modifications to this RSS feed at this time.');

      4/

      • error(get_string('missingfield', 'error', $name). " ".
      • get_string('erroronline', 'error', $linenum) .". ".
      • get_string('processingstops', 'error'),
      • 'uploaduser.php?sesskey='.$USER->sesskey);

      + //error(get_string('missingfield', 'error', $name). " ".
      + // get_string('erroronline', 'error', $linenum) .". ".
      + // get_string('processingstops', 'error'),
      + // 'uploaduser.php?sesskey='.$USER->sesskey);
      + print_error('missingfield', 'error', 'uploaduser.php?sesskey='.$USER->sesskey, $name);

      Show
      Petr Škoda added a comment - - edited regressions - please fix before end of Teasday review: 1/ error(get_string("invalidpubkey", 'mnet') . $errmsg ,'peers.php?step=update&hostid='.$mnet_peer->id); + //error(get_string("invalidpubkey", 'mnet') . $errmsg ,'peers.php?step=update&hostid='.$mnet_peer->id); + print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id, $errmsg); 2/ error(get_string('noguestpost', 'forum'). ' You are not allowed to make modifications to this RSS feed at this time.', $referrer); + //print_error(get_string('noguestpost', 'forum'). + // ' You are not allowed to make modifications to this RSS feed at this time.', + // $referrer); + print_error('noguestpost', 'forum', $referrer, 'You are not allowed to make modifications to this RSS feed at this time.'); } 3/ error(get_string('noguestpost', 'forum'). ' You are not allowed to make modifications to this RSS feed at this time.', $referrer); + //print_error(get_string('noguestpost', 'forum'). + // ' You are not allowed to make modifications to this RSS feed at this time.', + // $referrer); + print_error('noguestpost', 'forum', $referrer, 'You are not allowed to make modifications to this RSS feed at this time.'); 4/ error(get_string('missingfield', 'error', $name). " ". get_string('erroronline', 'error', $linenum) .". ". get_string('processingstops', 'error'), 'uploaduser.php?sesskey='.$USER->sesskey); + //error(get_string('missingfield', 'error', $name). " ". + // get_string('erroronline', 'error', $linenum) .". ". + // get_string('processingstops', 'error'), + // 'uploaduser.php?sesskey='.$USER->sesskey); + print_error('missingfield', 'error', 'uploaduser.php?sesskey='.$USER->sesskey, $name);
      Hide
      Martin Dougiamas added a comment - - edited

      1) Ah, I see the append now (looked like a comma). OK, yes revert

      2 and 3) Needs a whole new string yes (in lang/en_utf8/forum.php)

      4) yeah this is wierd, should be reverted

      Show
      Martin Dougiamas added a comment - - edited 1) Ah, I see the append now (looked like a comma). OK, yes revert 2 and 3) Needs a whole new string yes (in lang/en_utf8/forum.php) 4) yeah this is wierd, should be reverted
      Hide
      Dongsheng Cai added a comment -
      Show
      Dongsheng Cai added a comment - The bugs reported by Petr had been fixed, which could be found here: http://tracker.moodle.org/browse/MDL-14085?page=com.atlassian.jira.plugin.system.issuetabpanels:cvs-tabpanel
      Hide
      Eloy Lafuente (stronk7) added a comment -

      Revert confirmed. Closing.

      Show
      Eloy Lafuente (stronk7) added a comment - Revert confirmed. Closing.

        People

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

          Dates

          • Created:
            Updated:
            Resolved: