Moodle
  1. Moodle
  2. MDL-36365

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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

          Activity

          Hide
          Frédéric Massart added a comment -

          Looks good to me Adrian, thanks!

          Show
          Frédéric Massart added a comment - Looks good to me Adrian, thanks!
          Hide
          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
          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
          Adrian Greeve added a comment -

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

          Show
          Adrian Greeve added a comment - I'll create one for you today and let you know when I'm finished.
          Hide
          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
          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
          Dan Poltawski added a comment -

          Thanks Adrian, integrated to 2.4

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

          YAYYYY!!! It works as expected.

          Tested on master only.

          Test passed.

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

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

          (not really)

          Closing, thanks!

          Show
          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: