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

Importing entries into a database activity from a csv file containing empty lines results in an error

    Details

    • Testing Instructions:
      Hide

      Test steps

      1. Create a database activity.
      2. Create two fields.
      3. Create a csv file similar to the one mentioned in the description (It must have blank lines in the middle of the data).
      4. Go to [Settings ► Database activity administration ► Import entries].
      5. Upload the file.
        • Ensure that no errors are displayed and that the entries are imported correctly.
      Show
      Test steps Create a database activity. Create two fields. Create a csv file similar to the one mentioned in the description (It must have blank lines in the middle of the data). Go to [Settings ► Database activity administration ► Import entries] . Upload the file. Ensure that no errors are displayed and that the entries are imported correctly.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-36113-master

      Description

      We're handling empty lines at the end of the file but if an empty line is found in the middle a fatal error occurs.

      The database activity has a URL and text area field.

      myblog, about me
      http://bob.com,I am bob. Fear me.
      http://joe.com, I am joe. I like Joe. Joe good.
       
      http://blamo.com,blamo i am.
       
       

      Unable to read the raw data from the CSV file
       
      More information about this error
      Debug info:
      Error code: csvfailed
      Stack trace:
       
          line 467 of /lib/setuplib.php: moodle_exception thrown
          line 107 of /mod/data/import.php: call to print_error()

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    3/Dec/12