# modifyClass does not override action?

**URL:** https://meta.discourse.org/t/modifyclass-does-not-override-action/297051
**Category:** Development
**Created:** [February 28, 2024, 11:18am UTC](https://meta.discourse.org/t/modifyclass-does-not-override-action/297051 "2024-02-28T11:18:10Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [February 28, 2024, 11:18am UTC](https://meta.discourse.org/t/modifyclass-does-not-override-action/297051/1 "2024-02-28T11:18:11Z")

</div>

I’m working on fixing deprecations in [GitHub - paviliondev/discourse-legal-tools: Tools to help with legal compliance when using Discourse · GitHub](https://github.com/paviliondev/discourse-legal-tools/) and I found that the `api.modifyClass('controller:user-activity', {});` does not seem to be doing anything anymore ([here](https://github.com/paviliondev/discourse-legal-tools/blob/main/assets/javascripts/discourse/initializers/legal-edits.js.es6#L8))

The `exportUserArchive()` function still exists and the initializer is being called.

I already tried changing this to a pre-initializer and move the function outside of the `actions{}` but to no avail.

Is there anyone who can shine some light on this?

EDIT to add, this is apparently broken in 3.1 already.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [February 28, 2024, 4:37pm UTC](https://meta.discourse.org/t/modifyclass-does-not-override-action/297051/2 "2024-02-28T16:37:29Z")

</div>

So that code turns out to be stale.

The button was moved to `preferences/account` [UX: move data export to preferences page for new user nav (#20141) · discourse/discourse@e5f557b · GitHub](https://github.com/discourse/discourse/commit/e5f557b97104ca530a6ee6c2a737f762cba297b1) and the old code was never removed from the other controller.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [February 28, 2024, 4:38pm UTC](https://meta.discourse.org/t/modifyclass-does-not-override-action/297051/3 "2024-02-28T16:38:29Z")

</div>

Well done!

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [February 28, 2024, 4:50pm UTC](https://meta.discourse.org/t/modifyclass-does-not-override-action/297051/4 "2024-02-28T16:50:43Z")

</div>

@awesomerobot @david does some code here need removal?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [February 28, 2024, 5:23pm UTC](https://meta.discourse.org/t/modifyclass-does-not-override-action/297051/5 "2024-02-28T17:23:41Z")

</div>

Indeed! thanks for mentioning it… this will do it:

[https://github.com/discourse/discourse/pull/25932](https://github.com/discourse/discourse/pull/25932)

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [March 29, 2024, 5:24pm UTC](https://meta.discourse.org/t/modifyclass-does-not-override-action/297051/6 "2024-03-29T17:24:27Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
