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

Upgrade error related to block_recent_activity::migrate_logs



    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 2.7.3
    • Component/s: Logging
    • Labels:
    • Testing Instructions:
      1. Set your computer to store the apache logs (PHP error_log directive) in a file
      2. Install a Moodle 2.6
      3. Create a course
      4. Create 2 activities
      5. Update one of the activities
      6. Delete one of the activities
      7. Create an activity
      8. Upgrade to latest master (integration)
      9. Go to the course
      10. You SHOULD NOT see any error like the issue's summary one
      11. Check the apache logs
      12. You SHOULD NOT see any error like the issue's summary one
      Set your computer to store the apache logs (PHP error_log directive) in a file Install a Moodle 2.6 Create a course Create 2 activities Update one of the activities Delete one of the activities Create an activity Upgrade to latest master (integration) Go to the course You SHOULD NOT see any error like the issue's summary one Check the apache logs You SHOULD NOT see any error like the issue's summary one
    • Affected Branches:
    • Fixed Branches:
    • Pull from Repository:
    • Pull Master Branch:


      While testing MDLQA-7562, after doing what appeared to be a successful upgrade I noticed the following error pop up when I went to access a course with recent activities block on it:

      [Wed Oct 22 16:32:52.760410 2014] [:error] [pid 14749] [client] Default exception handler: Coding error detected, it must be fixed by a programmer: All dataobjects in insert_records() must have the same structure! Debug: 
      Error code: codingerror
      * line 1284 of /lib/dml/mysqli_native_moodle_database.php: coding_exception thrown
      * line 306 of /blocks/recent_activity/block_recent_activity.php: call to mysqli_native_moodle_database->insert_records()
      * line 151 of /blocks/recent_activity/block_recent_activity.php: call to block_recent_activity::migrate_logs()
      * line 73 of /blocks/recent_activity/block_recent_activity.php: call to block_recent_activity->get_structural_changes()
      * line 288 of /blocks/moodleblock.class.php: call to block_recent_activity->get_content()
      * line 230 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
      * line 962 of /lib/blocklib.php: call to block_base->get_content_for_output()
      * line 1014 of /lib/blocklib.php: call to block_manager->create_block_contents()
      * line 392 of /lib/outputrenderers.php: call to block_manager->ensure_content_created()
      * line 45 of /theme/clean/layout/columns3.php: call to core_renderer->standard_head_html()
      * line 915 of /lib/outputrenderers.php: call to include()
      * line 845 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      * line 243 of /course/view.php: call to core_renderer->header(
      , referer: http://mdlqa7562.jvla.org/course/index.php?categoryid=42

      For a moment, this error prevented access to the course but when I went back later it seemed to have resolved itself but it may be worth taking a look as to how log migration is taking place.

      Eloy commented:

      "seems that the built-in migration of information can easily end throwing that "All dataobjects in insert_records() must have the same structure!" because the check @ moodle_database::insert_records() verifying that is really extrict (a simple change in the order of fields for a record leads to the error).

      So I'd suggest you to create an issue about it, that should end guarantying that block_recent_activity:.migrate_logs() always return information satisfying moodle_database::insert_records(). Test covered, ideally."

      While I did pass the MDLQA-7562, I am going to tag this as a must fix for 2.8. If it proves to be less critical then the issues priority can obviously be downgraded. I'm not really sure what the best category is for this either - we'll start with logging. Peace - Anthony


          Issue Links



              dmonllao David Monllaó
              aborrow Anthony Borrow
              Peer reviewer:
              Dan Poltawski Dan Poltawski
              Damyon Wiese Damyon Wiese
              Sam Hemelryk Sam Hemelryk
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              0 Vote for this issue
              4 Start watching this issue


                Fix Release Date: