# Cannot trigger new AdminUser action in plugin

**URL:** https://meta.discourse.org/t/cannot-trigger-new-adminuser-action-in-plugin/113603
**Category:** Development
**Created:** [April 6, 2019, 3:07am UTC](https://meta.discourse.org/t/cannot-trigger-new-adminuser-action-in-plugin/113603 "2019-04-06T03:07:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Dannii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dannii/32/129087_2.png) [@Dannii](https://meta.discourse.org/u/Dannii)
#### Post date: [April 6, 2019, 3:07am UTC](https://meta.discourse.org/t/cannot-trigger-new-adminuser-action-in-plugin/113603/1 "2019-04-06T03:07:21Z")

</div>

I’m working on my first plugin, and am having trouble triggering an action. I have this template in the after-user-details connector:

> <https://github.com/curiousdannii/discourse-merge-users/blob/3d18dfdee81200e5f298bf8a8f9b050c728566ae/assets/javascripts/admin/templates/connectors/after-user-details/merge-users.hbs>

I then have this initialize script:

> <https://github.com/curiousdannii/discourse-merge-users/blob/3d18dfdee81200e5f298bf8a8f9b050c728566ae/assets/javascripts/admin/initializers/merge-users.js.es6>

So the template uses `action=(action "mergeInto")`. `mergeInto` is added to the actions object of AdminUserIndex, which then calls `AdminUser::mergeInto`. From what I can see, this matches [the other actions like `anonymize`, `destroy` etc](https://github.com/discourse/discourse/blob/b58867b6e936a5247304e9f06f827cf5012a92ed/app/assets/javascripts/admin/controllers/admin-user-index.js.es6#L187).

When I try clicking the button, I get this error:

```plaintext
Uncaught TypeError: Cannot read property 'apply' of undefined
    at e._join (_ember_jquery-5dbd79abddf53926275c73f77dbe61e7351258de8d2e886bf2ce86f144368848.js:57275)
    at e.join (_ember_jquery-5dbd79abddf53926275c73f77dbe61e7351258de8d2e886bf2ce86f144368848.js:57023)
    at c (_ember_jquery-5dbd79abddf53926275c73f77dbe61e7351258de8d2e886bf2ce86f144368848.js:45520)
    at _ember_jquery-5dbd79abddf53926275c73f77dbe61e7351258de8d2e886bf2ce86f144368848.js:17847
    at f (_ember_jquery-5dbd79abddf53926275c73f77dbe61e7351258de8d2e886bf2ce86f144368848.js:42670)
    at _ember_jquery-5dbd79abddf53926275c73f77dbe61e7351258de8d2e886bf2ce86f144368848.js:17846
    at n.click (_application-02da28b6813b1b32a18ca63f17b17a6324621575b9a375552668c1d2444c9dc4.js:44502)
    at n.trigger (_ember_jquery-5dbd79abddf53926275c73f77dbe61e7351258de8d2e886bf2ce86f144368848.js:38862)
    at n [as trigger] (_ember_jquery-5dbd79abddf53926275c73f77dbe61e7351258de8d2e886bf2ce86f144368848.js:36445)
    at e._run (_ember_jquery-5dbd79abddf53926275c73f77dbe61e7351258de8d2e886bf2ce86f144368848.js:57292)

```

I’m guessing that one or both of the reopens didn’t work properly? Or that the button action isn’t working properly?

Or, this topic suggests plugin-outlets need to manually specify actions in the args, is that true? Is it practical to add new actions like this in a plugin?

> [@Using a Discourse component in a plugin](https://meta.discourse.org/t/using-a-discourse-component-in-a-plugin/56155):
>
> I have a question about reusing Discourse “core” Ember components in plugins. More particularly, I ran into trouble today trying to put a “signup” d-button into a plugin template. Here is where I tried to do: And this is the console error it created: I understand (very vaguely?) that showCreateAccount is a controller function passed along to different components that need it: Moreover, in order to get this modal to pop up in my component, do I need to fundamentally change the str…

I’m thinking it might be better to make a new admin page for this.
