Moodle
  1. Moodle
  2. MDL-12885

Notice: Trying to get property of non-object in /var/www/mahara/admin/mnet/mnet_services.php on line 60

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: MNet
    • Labels:
      None
    • Environment:
      Debian Etch, running cvshead
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Rank:
      15005

      Description

      In the admin section, under Networking => Peers. When I have chosen a peer, if I go to the services tab and change some of the checkboxes, upon save I get notices like:

      Notice: Trying to get property of non-object in /var/www/mahara/admin/mnet/mnet_services.php on line 60

      I had set up a Mahara peer, although I don't think the type of peer matters.

      The offending line is:

      } elseif ($host2service->publish != $publish || $host2service->subscribe != $subscribe) {

      $host2service is defined on line 47:

      $host2service = get_record('mnet_host2service', 'hostid', $_POST['hostid'], 'serviceid', $key);

      The following psql output might help:

      moodle-mahara=# \d mdl_mnet_host2service
      Table "public.mdl_mnet_host2service"
      Column | Type | Modifiers
      -------------------------------------------------------------------------------------
      id | bigint | not null default nextval('mdl_mnet_host2service_id_seq'::regclass)
      hostid | bigint | not null default 0
      serviceid | bigint | not null default 0
      publish | smallint | not null default 0
      subscribe | smallint | not null default 0
      Indexes:
      "mdl_mnethost_id2_pk" PRIMARY KEY, btree (id)
      "mdl_mnethost_hosser_uix" UNIQUE, btree (hostid, serviceid)

      moodle-mahara=# select * from mdl_mnet_host2service;
      id | hostid | serviceid | publish | subscribe
      -----------------------------------
      1 | 3 | 1 | 0 | 1
      2 | 3 | 2 | 1 | 0
      (2 rows)

        Issue Links

          Activity

          Hide
          Penny Leach added a comment -

          Hm, I don't have this problem in HEAD now - Nigel I don't suppose you still have that database lying around, do you?

          Show
          Penny Leach added a comment - Hm, I don't have this problem in HEAD now - Nigel I don't suppose you still have that database lying around, do you?
          Hide
          Nigel McNie added a comment -

          Nowhere that I can get at it, sorry.

          Show
          Nigel McNie added a comment - Nowhere that I can get at it, sorry.
          Hide
          Penny Leach added a comment -

          Closing as now I see how long ago this bug was reported. Donal actually changed some stuff in that file a few weeks after your bug report Nigel, so it may be that it was fixed then. Reading through the code now I can't see how this could be triggered.

          Show
          Penny Leach added a comment - Closing as now I see how long ago this bug was reported. Donal actually changed some stuff in that file a few weeks after your bug report Nigel, so it may be that it was fixed then. Reading through the code now I can't see how this could be triggered.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: