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

"Notice: Trying to get property 'id' of non-object in /..../backup/restore.php on line 176

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.7, 3.8, 3.9
    • Fix Version/s: 3.7.5, 3.8.2
    • Component/s: Backup
    • Labels:
    • Testing Instructions:
      Hide

      Enable asynchronous backup

      1. Log in as admin
      2. Navigate to Courses > Backups > Asynchronous backup/restore in site administration
      3. Tick Enable asynchronous backups and press Save changes

      Create a course backup

      1. Create a new course
      2. Add one or two activities to the course (a couple of labels is enough)
      3. Under Actions menu select Backup
      4. Untick everything except Include activities and resources
      5. Press Jump to final step
      6. Wait for backup to complete
      7. Press Continue
      8. Press Download to save the backup to your local machine

      Restore course backup

      1. Navigate to Courses > Restore course in site administration
      2. Upload the backup file you just created to the Import a backup file and press Restore
      3. Under Restore into an existing course select the same course you previously created
      4. Press Continue
      5. Press Next
      6. Press Next
      7. Press Perform restore
      8. Confirm the URL for the Return to course button is your wwwroot
      9. Confirm you don't see any errors (on screen/in your webserver log) like the following:

        [Fri Dec 06 16:00:29.261177 2019] [php7:notice] [pid 3544] [client 192.168.122.1:47078] PHP Notice:  Trying to get property 'id' of non-object in /opt/moodle/master/src/backup/restore.php on line 176, referer: http://moodle.internal/master/backup/restore.php
        [Fri Dec 06 16:01:14.689945 2019] [php7:notice] [pid 3543] [client 192.168.122.1:47102] PHP Notice:  Trying to get property 'id' of non-object in /opt/moodle/master/src/backup/externallib.php on line 94, referer: http://moodle.internal/master/backup/restore.php

      Show
      Enable asynchronous backup Log in as admin Navigate to Courses > Backups > Asynchronous backup/restore in site administration Tick Enable asynchronous backups and press Save changes Create a course backup Create a new course Add one or two activities to the course (a couple of labels is enough) Under Actions menu select Backup Untick everything except Include activities and resources Press Jump to final step Wait for backup to complete Press Continue Press Download to save the backup to your local machine Restore course backup Navigate to Courses > Restore course in site administration Upload the backup file you just created to the Import a backup file and press Restore Under Restore into an existing course select the same course you previously created Press Continue Press Next Press Next Press Perform restore Confirm the URL for the Return to course button is your wwwroot Confirm you don't see any errors (on screen/in your webserver log) like the following: [Fri Dec 06 16:00:29.261177 2019] [php7:notice] [pid 3544] [client 192.168.122.1:47078] PHP Notice: Trying to get property 'id' of non-object in /opt/moodle/master/src/backup/restore.php on line 176, referer: http://moodle.internal/master/backup/restore.php [Fri Dec 06 16:01:14.689945 2019] [php7:notice] [pid 3543] [client 192.168.122.1:47102] PHP Notice: Trying to get property 'id' of non-object in /opt/moodle/master/src/backup/externallib.php on line 94, referer: http://moodle.internal/master/backup/restore.php
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull 3.8 Branch:
    • Pull Master Branch:

      Description

      Analysis...

      The code tries to read $course->id. However, the variable $course is never defined in this file. This was added in MDL-28505

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pholden Paul Holden
              Reporter:
              howardsmiller Howard Miller
              Peer reviewer:
              Peter Dias
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Anna Carissa Sadia
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Mar/20

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 1 minute
                  4h 1m