# CSV export of reports is broken

**URL:** https://meta.discourse.org/t/csv-export-of-reports-is-broken/116501
**Category:** Bug
**Created:** [May 1, 2019, 1:30am UTC](https://meta.discourse.org/t/csv-export-of-reports-is-broken/116501 "2019-05-01T01:30:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mbauman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mbauman/32/139835_2.png) [@mbauman](https://meta.discourse.org/u/mbauman)
#### Post date: [May 1, 2019, 1:30am UTC](https://meta.discourse.org/t/csv-export-of-reports-is-broken/116501/1 "2019-05-01T01:30:36Z")

</div>

Attempting to export a variety of reports (`*.discourse.org/admin/reports/likes` and `topics` and `posts` and `pageviews` and more…) yields a javascript error in the console:

```plaintext
Uncaught TypeError: Cannot read property 'category' of null
    at n.exportCsv (_admin-782325fc6304acaa8b3709a0e15ff70a65de97eea7b4b811d6dbe1315e86d3b0.js:4568)
    at e.r._join (_ember_jquery-a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:62460)
    at e.r.join (_ember_jquery-a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:62173)
    at c (_ember_jquery-a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:49023)
    at _ember_jquery-a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:19131
    at h (_ember_jquery-a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:46648)
    at _ember_jquery-a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:19130
    at n.click (_application-555069f6ee111c9cd19c85f6ce9c364b7583a0ba0a2ab416efdcb430428bd5f7.js:45388)
    at n.trigger (_ember_jquery-a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:42680)
    at n [as trigger] (_ember_jquery-a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:40180)

```

I can export CSVs for those reports for which I can manually set a category (instead of using the default “all categories”), but of course that’s not terribly helpful when I actually want to export all categories.

This used to work a few months ago but has recently regressed.

I’m using Chrome Version 74.0.3729.131 (Official Build) beta (64-bit) on macOS, but I see the same behavior with Safari, too.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 1, 2019, 1:35am UTC](https://meta.discourse.org/t/csv-export-of-reports-is-broken/116501/2 "2019-05-01T01:35:43Z")

</div>

@techAPJ can you test this?

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [May 1, 2019, 4:51am UTC](https://meta.discourse.org/t/csv-export-of-reports-is-broken/116501/4 "2019-05-01T04:51:42Z")

</div>

Thats mine for sure will fix it today

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [May 1, 2019, 4:52am UTC](https://meta.discourse.org/t/csv-export-of-reports-is-broken/116501/5 "2019-05-01T04:52:43Z")

</div>

No worries. I have a simple fix ready, pushing in next 10 mins. 🙂

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [May 1, 2019, 5:17am UTC](https://meta.discourse.org/t/csv-export-of-reports-is-broken/116501/6 "2019-05-01T05:17:40Z")

</div>

There were two issues here. Fixed via:

[https://github.com/discourse/discourse/commit/002e1f560a657bcc85d6668689da51ef46ab8f2c](https://github.com/discourse/discourse/commit/002e1f560a657bcc85d6668689da51ef46ab8f2c)

and

[https://github.com/discourse/discourse/commit/c6409fd2cc98bf53caddbbcfc81359dbd4a820c2](https://github.com/discourse/discourse/commit/c6409fd2cc98bf53caddbbcfc81359dbd4a820c2)

Thanks for reporting this issue @mbauman 👍

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [May 1, 2019, 5:28am UTC](https://meta.discourse.org/t/csv-export-of-reports-is-broken/116501/7 "2019-05-01T05:28:51Z")

</div>


