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

Faulty plugin uninstallation logic causes redundant table reads

XMLWordPrintable

    • MOODLE_400_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-77988-401
    • Hide
      1. Log in as admin
      2. Navigate to Plugins > Manage activities in site administration
      3. Uninstall the Book module
      4. Press Continue on the confirmation page
      5. Pause when you see the following message:

        All data associated with the plugin mod_book has been deleted from the database. To prevent the plugin re-installing itself, its folder /var/www/html/mod/book must be manually removed from your server now. Moodle itself cannot remove the folder due to write permissions.
        

      6. Open DB editor
      7. Confirm that the following tables have been removed from the database:
        • mdl_book
        • mdl_book_chapters
      8. Back in Moodle, press Continue and allow the Book module to re-install itself
        • Note: If this does not happen because the web server actually was able to delete the book folder, just run "git reset --hard" to restore the book folder. Then proceed to reinstall the book activity module.
      9. Manually delete the folder /var/www/html/mod/book
      10. Back in Moodle, navigate to Notifications in site administration
      11. Complete the upgrade step related to missing Book module
      12. Navigate to Plugins > Manage activities in site administration
      13. Uninstall the Book module
      14. Press Continue on the confirmation page
      15. Uninstall the book (Missing from disk) module
      16. Press Continue on the confirmation page
      17. Open DB editor
      18. Confirm that the following tables have been removed from the database:
        • mdl_book
        • mdl_book_chapters

      Note 2: At the end of the test, make sure to reset your Moodle instance's codebase (e.g. via "git reset --hard")

      Show
      Log in as admin Navigate to Plugins > Manage activities in site administration Uninstall the Book module Press Continue on the confirmation page Pause when you see the following message: All data associated with the plugin mod_book has been deleted from the database. To prevent the plugin re-installing itself, its folder /var/www/html/mod/book must be manually removed from your server now. Moodle itself cannot remove the folder due to write permissions. Open DB editor Confirm that the following tables have been removed from the database: mdl_book mdl_book_chapters Back in Moodle, press Continue and allow the Book module to re-install itself Note: If this does not happen because the web server actually was able to delete the book folder, just run " git reset --hard " to restore the book folder. Then proceed to reinstall the book activity module. Manually delete the folder /var/www/html/mod/book Back in Moodle, navigate to Notifications in site administration Complete the upgrade step related to missing Book module Navigate to Plugins > Manage activities in site administration Uninstall the Book module Press Continue on the confirmation page Uninstall the book (Missing from disk) module Press Continue on the confirmation page Open DB editor Confirm that the following tables have been removed from the database: mdl_book mdl_book_chapters Note 2: At the end of the test, make sure to reset your Moodle instance's codebase (e.g. via " git reset --hard ")

      As discussed with stronk7, hence creating this issue

      This block is effectively:

      if (true and void)
          return
      

      Example: https://3v4l.org/JDJoY (same behaviour if substituting && for and)

      This conditional can never pass, which means the remainder of the method is always executed

      Discovered during the adventure of MDL-77927

            pholden Paul Holden
            pholden Paul Holden
            Andrew Lyons Andrew Lyons
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.