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

Can not Import a tab separated file with tabs at the end.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      Hide

      Test steps

      1. Go to [Settings ► Users ► Accounts ► User profile fields].
      2. Create a user profile field.
      3. Go to [Settings ► Users ► Accounts ► Bulk user actions].
      4. Download the users as a text document (.csv).
      5. Alter the file so that the separators are now tabs. (Through open office, excel, or manually)
      6. Go to [Settings ► Users ► Accounts ► Upload users].
      7. Upload the tab separated file.
      8. Set the 'CSV delimiter' to '\t'.
        • Ensure that there is no error displayed, and that there is a preview of the file.
      Show
      Test steps Go to [Settings ► Users ► Accounts ► User profile fields] . Create a user profile field. Go to [Settings ► Users ► Accounts ► Bulk user actions] . Download the users as a text document (.csv). Alter the file so that the separators are now tabs. (Through open office, excel, or manually) Go to [Settings ► Users ► Accounts ► Upload users] . Upload the tab separated file. Set the 'CSV delimiter' to '\t'. Ensure that there is no error displayed, and that there is a preview of the file.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-36365-master

      Description

      Importing a tab separated file with tabs at the end doesn't work.
      This is because the trim() function by default removes tabs when trimming the data.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            fred Frédéric Massart added a comment -

            Looks good to me Adrian, thanks!

            Show
            fred Frédéric Massart added a comment - Looks good to me Adrian, thanks!
            Hide
            poltawski Dan Poltawski added a comment -

            You know what would make this issue even better? A simple tab delimitered csv file in /lib/tests/fixtures/, with a test reading that file in using csvlib

            Show
            poltawski Dan Poltawski added a comment - You know what would make this issue even better? A simple tab delimitered csv file in /lib/tests/fixtures/, with a test reading that file in using csvlib
            Hide
            abgreeve Adrian Greeve added a comment -

            I'll create one for you today and let you know when I'm finished.

            Show
            abgreeve Adrian Greeve added a comment - I'll create one for you today and let you know when I'm finished.
            Hide
            abgreeve Adrian Greeve added a comment -

            Okay, I've created a tab separated file and included a unit test to load that into the system.

            Show
            abgreeve Adrian Greeve added a comment - Okay, I've created a tab separated file and included a unit test to load that into the system.
            Hide
            poltawski Dan Poltawski added a comment -

            Thanks Adrian, integrated to 2.4

            Show
            poltawski Dan Poltawski added a comment - Thanks Adrian, integrated to 2.4
            Hide
            rwijaya Rossiani Wijaya added a comment -

            YAYYYY!!! It works as expected.

            Tested on master only.

            Test passed.

            Show
            rwijaya Rossiani Wijaya added a comment - YAYYYY!!! It works as expected. Tested on master only. Test passed.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Amazed. Inspired. Grateful. That’s how your generosity makes me feel.

            (not really)

            Closing, thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Amazed. Inspired. Grateful. That’s how your generosity makes me feel. (not really) Closing, thanks!

              People

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

                Dates

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