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

Prettify data format JSON exported data

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8
    • Fix Version/s: 3.8
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      Hide
      Prettify JSON test
      1. Log in as admin.
      2. Go to Site administration > Reports > Logs
      3. Click Get these logs button.
      4. Scroll down in the bottom choose Javascript Object Notation (.json) in the Download table data as field and click Download button.
      5. Open the exported file and make sure the JSON content is formatted (not a big mess)
      Unicode test
      1. You'll need an user with some unicode characters, for example: یاسمین علیزاده"
      2. As admin, go to Site administration > Users > Accounts > Bulk user actions
      3. In the users list, find that user and then click Add to selection.
      4. Then, in the With selected users... field, choose Download and click Go
      5. In the next page, choose Javascript Object Notation (.json) in the drop-down and click Download.
      6. Make sure the content gets exported with the same characters (یاسمین علیزاده) not something like \u06cc\u0627\u0633\u0645\u06cc\u0646
      7. Also, the content should be indented (pretty), not a big mess.
      Show
      Prettify JSON test Log in as admin. Go to Site administration > Reports > Logs Click Get these logs button. Scroll down in the bottom choose Javascript Object Notation (.json) in the Download table data as field and click Download button. Open the exported file and make sure the JSON content is formatted (not a big mess) Unicode test You'll need an user with some unicode characters, for example: یاسمین علیزاده" As admin, go to Site administration > Users > Accounts > Bulk user actions In the users list, find that user and then click Add to selection . Then, in the With selected users... field, choose Download and click Go In the next page, choose Javascript Object Notation (.json) in the drop-down and click Download . Make sure the content gets exported with the same characters (یاسمین علیزاده) not something like \u06cc\u0627\u0633\u0645\u06cc\u0646 Also, the content should be indented (pretty), not a big mess.
    • Affected Branches:
      MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-66288-master

      Description

      I have came across this while working on MDL-9469.

      When exporting large sets of data it's almost impossible to read the exported JSON content because the data is not formatted.

      Discussing further with Andrew Nicols we thought about changing the dataformat JSON write_record() to use JSON_PRETTY_FORMAT so the exported content is easier to read.

        Attachments

          Activity

            People

            Assignee:
            lameze Simey Lameze
            Reporter:
            lameze Simey Lameze
            Peer reviewer:
            Andrew Nicols
            Integrator:
            Jun Pataleta
            Tester:
            Jennifer Bauzon
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              18/Nov/19

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 35 minutes
                1h 35m