Moodle
  1. Moodle
  2. MDL-42427

undefined var $sqlwhere when running automated backups

    Details

    • Testing Instructions:
      Hide
      1. Log in as admin
      2. Ensure there are multiple courses created on your site.
      3. Set the following site configuration settings...
        backup_auto_active - manual
        backup_auto_storage - specified directory
        backup_auto_destination - path to some writeable dir
        backup_auto_skip_modif_prev - checked
        backup_auto_skip_modif_days - never
      4. Run the script php admin/cli/automated_backups.php and make sure no errors or notices are generated.
      5. Run the script php admin/cli/automated_backups.php again and make sure no errors or notices are generated.
      Show
      Log in as admin Ensure there are multiple courses created on your site. Set the following site configuration settings... backup_auto_active - manual backup_auto_storage - specified directory backup_auto_destination - path to some writeable dir backup_auto_skip_modif_prev - checked backup_auto_skip_modif_days - never Run the script php admin/cli/automated_backups.php and make sure no errors or notices are generated. Run the script php admin/cli/automated_backups.php again and make sure no errors or notices are generated.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-42427-master
    • Sprint:
      BACKEND Sprint 6

      Description

      automated backups produce following notice:-

      Notice: Undefined variable: sqlwhere in /var/www/int/25/moodle/backup/util/helper/backup_cron_helper.class.php on line 172
       
      Call Stack:
          0.0002     241200   1. {main}() /var/www/int/25/moodle/admin/cli/automated_backups.php:0
          0.2096   29878800   2. backup_cron_automated_helper::run_automated_backup() /var/www/int/25/moodle/admin/cli/automated_backups.php:95

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Mark Nelson added a comment -

            Hi Ankit,

            This seems fine as you are just copying the same query from above, which would have been used in this case had it been defined. However, I do not like the spacing. I believe you should add spacing before and after operators and when concatenating strings. eg.

            "course = :courseid AND time > :time AND " . $DB->sql_like('action', ':action', false, true, true);

            Cheers!

            Show
            Mark Nelson added a comment - Hi Ankit, This seems fine as you are just copying the same query from above, which would have been used in this case had it been defined. However, I do not like the spacing. I believe you should add spacing before and after operators and when concatenating strings. eg. "course = :courseid AND time > :time AND " . $DB->sql_like('action', ':action', false, true, true); Cheers!
            Hide
            Ankit Agarwal added a comment -

            Thanks Mark,
            spaces around . are optional, pushing forward.
            http://docs.moodle.org/dev/Coding_style#String_concatenation

            Show
            Ankit Agarwal added a comment - Thanks Mark, spaces around . are optional, pushing forward. http://docs.moodle.org/dev/Coding_style#String_concatenation
            Hide
            Dan Poltawski added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            Hide
            Marina Glancy added a comment -

            holding as it conflicts with MDL-37181

            Show
            Marina Glancy added a comment - holding as it conflicts with MDL-37181
            Hide
            Ankit Agarwal added a comment -

            rebased,
            Thanks

            Show
            Ankit Agarwal added a comment - rebased, Thanks
            Hide
            Marina Glancy added a comment -

            Thanks Ankit, integrated in 2.4, 2.5 and master

            Show
            Marina Glancy added a comment - Thanks Ankit, integrated in 2.4, 2.5 and master
            Hide
            Rossiani Wijaya added a comment -

            This is working as expected.

            Tested for 2.4, 2.5 and master.

            Test passed.

            Show
            Rossiani Wijaya added a comment - This is working as expected. Tested for 2.4, 2.5 and master. Test passed.
            Hide
            Eloy Lafuente (stronk7) added a comment -

            "Aequam memento rebus in arduis servare mentem"

            Many thanks for your hard work, this is now part of "Moodle, the LMS". Closing!

            Ciao

            Show
            Eloy Lafuente (stronk7) added a comment - "Aequam memento rebus in arduis servare mentem" Many thanks for your hard work, this is now part of "Moodle, the LMS". Closing! Ciao

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Agile