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

Database activity does not store the last time activity instances were modified

    XMLWordPrintable

Details

    • MOODLE_31_STABLE
    • MOODLE_31_STABLE
    • MDL-53149-master
    • Hide
      1. In a 3.0 instance create a few database activites
      2. Look at the database and ensure the data table does not have the timmodified field, e.g.

        select id,timemodified from mdl_data;
        column "timemodified" does not exist
        LINE 1: select id,timemodified from mdl_data
        

      3. Upgrade to version including this patch
      4. VERIFY: The table now has the timemodified field and it is set to 0. e.g.

        select id,timemodified from mdl_data;
        +------+----------------+
        |   id |   timemodified |
        |------+----------------|
        |    1 |              0 |
        +------+----------------+
        

      5. Update the database activity and change one of its settings in the web ui
      6. Verify the timemodified field has been changed:

        select id,timemodified from mdl_data;
        +------+----------------+
        |   id |   timemodified |
        |------+----------------|
        |    1 |     1456997054 |
        +------+----------------+
        

      7. Create a new database activity module
      8. VERIFY: the timemodiifed field for the newly created record is set

        select id,timemodified from mdl_data;
        +------+----------------+
        |   id |   timemodified |
        |------+----------------|
        |    1 |     1456997054 |
        |    2 |     1456997211 |
        +------+----------------+
        

      9. backup and restore a course with database activity in it. Ensure the timemodified field value is preserved
      Show
      In a 3.0 instance create a few database activites Look at the database and ensure the data table does not have the timmodified field, e.g. select id,timemodified from mdl_data; column "timemodified" does not exist LINE 1: select id,timemodified from mdl_data Upgrade to version including this patch VERIFY: The table now has the timemodified field and it is set to 0. e.g. select id,timemodified from mdl_data; +------+----------------+ | id | timemodified | |------+----------------| | 1 | 0 | +------+----------------+ Update the database activity and change one of its settings in the web ui Verify the timemodified field has been changed: select id,timemodified from mdl_data; +------+----------------+ | id | timemodified | |------+----------------| | 1 | 1456997054 | +------+----------------+ Create a new database activity module VERIFY: the timemodiifed field for the newly created record is set select id,timemodified from mdl_data; +------+----------------+ | id | timemodified | |------+----------------| | 1 | 1456997054 | | 2 | 1456997211 | +------+----------------+ backup and restore a course with database activity in it. Ensure the timemodified field value is preserved

    Description

      It is strange because add_instance and update_instance set timemodified, but there is no timemodified field in the database. Probably copy & paste issue.

      We need mod_data db table to contain a timemodified for search.

      Attachments

        Issue Links

          Activity

            People

              poltawski Dan Poltawski
              dmonllao David Monllaó
              David Monllaó David Monllaó
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Mark Nelson Mark Nelson
              Amaia Anabitarte, Carlos Escobedo, Laurent David, Mikel Martín Corrales, Sabina Abellan, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                23/May/16