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

Importing User Metadata fields to database activity fails

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a database activity with approval, add two fields
      2. Add some entries as a student
      3. Approve them as a teacher
      4. Export database activity and check additional checkboxes (include timemodified, user meta data, time approved), save the file
      5. Delete all entries from the database and import the file, make sure everything is imported
      6. Completely delete one field from the database
      7. Import the file again, the error should be displayed and entries not imported
      Show
      Create a database activity with approval, add two fields Add some entries as a student Approve them as a teacher Export database activity and check additional checkboxes (include timemodified, user meta data, time approved), save the file Delete all entries from the database and import the file, make sure everything is imported Completely delete one field from the database Import the file again, the error should be displayed and entries not imported
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull Master Branch:
      wip-MDL-40408-master

      Description

      I initially tried to capture information about practical tasks students attempt using Feedback - but each time they submit a new form it overwrites. I switched to a database activity and that works fine - but I wanted to import the original entries rather than have all students resubmit attempts.

      I exported a sample of the database to get the correct fields, with the optional 'include user details' tickbox, then added the records exported from the Feedback activity with the same fields.

      When I tried to upload I got the error:

      The following fields in your file are not known in this database: 'User' 'Username' 'Email address' 'Time added' 'Time modified'

      More information about this error
      Debug info:
      Error code: fieldnotmatched
      Stack trace:

      line 476 of /lib/setuplib.php: moodle_exception thrown
      line 122 of /mod/data/import.php: call to print_error()

      The field names all came from the Moodle database export, but it's only recognising fields I added manually. The user metadata fields that come with the tickbox 'include user data' are not being recognised as part of the csv import even although content already exists with those field names.

      Thanks, Gordon.

        Attachments

          Activity

            People

            Assignee:
            marina Marina Glancy
            Reporter:
            gordonmc Gordon McLeod
            Peer reviewer:
            Damyon Wiese
            Integrator:
            Dan Poltawski
            Tester:
            John Okely
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/Sep/17