Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-28668

Cannot update a deleted remote site entry : wrong url (not full path) for print_error() functions in admin/mnet/peers.php

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.12
    • Fix Version/s: None
    • Component/s: MNet
    • Labels:
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      I guess that the cause of this problem is side-effect of changing specification of function print_error().
      Third parameter, URI, is needed as full path style. NG: peers.php OK: http://www.yoursite.com/moodle/admin/mnet/peers.php

      Then, we cannot update a database entry which was deleted (mdl_mnet_host, deleted = 1).

      for example,

      .       // PREVENT DUPLICATE RECORDS ///////////////////////////////////////////
              if ('input' == $form->step) {
                  if ( isset($mnet_peer->id) && $mnet_peer->id > 0 ) {
                      print_error("hostexists", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id, $mnet_peer->id);
                  }
              }
       
       ===>  print_error("hostexists", 'mnet', $CFG->wwwroot.'/admin/mnet/peers.php?step=update&hostid='.$mnet_peer->id, $mnet_peer->id);

      furthermore:
      a) These are not so serious;

      print_error('xmlrpc-missing', 'mnet','peers.php');
      print_error("invalidurl", 'mnet','peers.php');

      b) This provide for us same serious troubles;

      print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id);

      c) I guess that this is one of solutions however it's not so good solution since error() is old style and will be disappear soon;

      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);

        Attachments

          Activity

            People

            Assignee:
            mudrd8mz David Mudrák (@mudrd8mz)
            Reporter:
            shirai Tatsuya Shirai
            Participants:
            Component watchers:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: