Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-1393

Errors in module restore due to variables names being reused while variable name still in scope.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 1.9.4
    • Patch: Elluminate
    • None
    • Any
    • Easy
    • MOODLE_19_STABLE

      $recordings and $recording being reused:

      The following error can be displayed when restoring a course containing
      Elluminate activities:

      Elluminate Live! Meeting "Demonstration"
      Fatal error: Cannot use object of type stdClass as array in
      /fs2/www/html/daw438/oumoodle/mod/elluminatelive/restorelib.php on line 164

      The error is occurring because the variable in question ($recording) can be
      corrupted due to loops within loops using the same variable names

      Changed inner loop variables from recordings and recording to recordingslist
      and recording item respectively so they do not conflict with the outer loop
      variables recordings and recording.

      $user being reused:

      The following errors can be displayed when restoring a course containing
      elluminate activities causing the restore to fail:

      Elluminate Live! Meeting "Demonstration"
      Warning: pg_query() [function.pg-query]: Query failed: ERROR: duplicate key
      violates unique constraint "ou_elluuser_elmelm_uix" in
      /fs2/www/html/daw438/oumoodle/lib/adodb/drivers/adodb-postgres7.inc.php on line
      115

      ADOConnection._Execute(INSERT INTO ou_elluminatelive_users (
      ID, USERID ) VALUES ( 10, 1302 ), false) % line 891, file: adodb.inc.php
      ADOConnection.Execute(INSERT INTO ou_elluminatelive_users ( ID,
      USERID ) VALUES ( 10, 1302 )) % line 1680, file: dmllib.php
      insert_record(elluminatelive_users, Object:stdClass) % line 365,
      file: restorelib.php
      elluminatelive_users_restore_mods(6, Array[1], Object:stdClass) % line
      185, file: restorelib.php
      elluminatelive_restore_mods(Object:object, Object:stdClass) % line 4563,
      file: restorelib.php
      ERROR: duplicate key violates unique constraint "ou_elluuser_elmelm_uix"

      INSERT INTO ou_elluminatelive_users ( ID, USERID ) VALUES ( 10, 1302 )
      line 1681 of lib/dmllib.php: call to debugging()
      line 365 of mod/elluminatelive/restorelib.php: call to insert_record()
      line 185 of mod/elluminatelive/restorelib.php: call to
      elluminatelive_users_restore_mods()
      line 4563 of backup/restorelib.php: call to elluminatelive_restore_mods()
      line 9251 of backup/restorelib.php: call to restore_create_modules()
      line 55 of backup/restore_execute.html: call to restore_execute()
      line 193 of backup/restore.php: call to include_once()

      Warning: pg_query() [function.pg-query]: Query failed: ERROR: current
      transaction is aborted, commands ignored until end of transaction block in
      /fs2/www/html/daw438/oumoodle/lib/adodb/drivers/adodb-postgres7.inc.php on line
      115

      Another instance where a variable is corrupted by unintentionally overwriting
      it. In this case the variable $user is being used to create an elluminate user
      object for insertion into the database, but the same variable name is then used
      to obtain the corresponding moodle user, overwriting/deleting all the
      elluminate user information.

      Replaced second reference to $user by $moodle_user to prevent corruption of
      $user object to be inserted into elluminate_users table

            jfilip Justin Filip (Inactive)
            rtcn2 Rod Norfor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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