# New layout refresh problem

**URL:** https://community.forestadmin.com/t/new-layout-refresh-problem/3456
**Category:** Help me!
**Created:** [October 5, 2021, 2:30pm UTC](https://community.forestadmin.com/t/new-layout-refresh-problem/3456 "2021-10-05T14:30:17Z")
**Posts on this page:** 6
**Page:** 2

<div class="post-metadata">

### Author: ![Sliman\_Medini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sliman_medini/32/19_2.png) [@Sliman\_Medini](https://community.forestadmin.com/u/Sliman_Medini)
#### Post date: [October 21, 2021, 3:47pm UTC](https://community.forestadmin.com/t/new-layout-refresh-problem/3456/21 "2021-10-21T15:47:20Z")

</div>

Hi @Louis-Marie,

The elements you shared in private allowed to see more in details what happened.  
The problem does not come from your layout, it is located in the smart action load hook mechanism.

We were not able to reproduce locally.

At some point your server sends the smart action fields with the missing enum.

Can I ask you to put `console.log(fields)` in your load function?  
This would allow us to check if the enum value were drop before or after the function call.

Regards

---

<div class="post-metadata">

### Author: ![Louis-Marie](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Louis-Marie](https://community.forestadmin.com/u/Louis-Marie)
#### Post date: [October 21, 2021, 6:50pm UTC](https://community.forestadmin.com/t/new-layout-refresh-problem/3456/22 "2021-10-21T18:50:45Z")

</div>

Hi @Sliman_Medini

ok, thank you for your suggestion.  
We are progressing…

I started adding the `console.log(fields)` to my load function in my `vusers` collection, and nothing was logged, so I didn’t understand what was wrong.

After that, I remembered that I have exactly the same smart action name in another collection named `vusers_monitorings`, which points to the same endpoint.

Let’s see:

```javascript
Liana.collection('users', {
  actions: [
    ...
    { name: 'Mail request user action',
      type: 'bulk',
      endpoint: 'forest/actions/mails/request_user_action',
      fields: [{
        field: 'Mail_template',
        ...
       }],
      hooks: {
        load: ({ fields /* , request */ }) => {
          console.log(' ********users***************');
          console.log(fields);
          ...
        },
      },
    },
    ...
    },
  ],
});

```

and for the other collection:

```javascript
Liana.collection('vuser_monitorings', {
  actions: [
    ...
    { name: 'Mail request user action',
      type: 'bulk',
      endpoint: 'forest/actions/mails/request_user_action',
      fields: [{
        field: 'Mail_template',
        ...
       }],
      hooks: {
        load: ({ fields /* , request */ }) => {
          console.log(' ********vuser_monitorings***************');
          console.log(fields);
          ...
        },
      },
    },
    ...
    },
  ],
});

```

And the result:

- in `Development` environment, the log of users is displayed correctly.
- in `Staging` environment, the log of vuser\_monitorings is displayed when I am activating the action in `users` collection.

That is the source of the problem.  
==\> **the wrong load hook is called when two smart actions have the same name in two different collections.**  
It explains my issue, because my `Dummy item` was added in the `users` collection only.

Could you please try this scenario and let me know if you are able to reproduce this issue?  
**Reminder** : for me, it happens only in Staging, and Production (not in Development).

Thanks in advance.

---

<div class="post-metadata">

### Author: ![Sliman\_Medini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sliman_medini/32/19_2.png) [@Sliman\_Medini](https://community.forestadmin.com/u/Sliman_Medini)
#### Post date: [October 22, 2021, 8:21am UTC](https://community.forestadmin.com/t/new-layout-refresh-problem/3456/23 "2021-10-22T08:21:09Z")

</div>

Hi @Louis-Marie,

Yes we are progressing 🙂

We reproduced the issue “2 smart actions with same name”.  
As a workaround for now, you can make your smart action names unique.

A bug ticket was created, you can follow the [resolution here](https://sharing.clickup.com/t/h/1ht1ax9/X3ONUDXSLWKVXKK).

EDIT: Having different names for smart actions is not enough. **Endpoint must be also different.**

Regards

---

<div class="post-metadata">

### Author: ![Louis-Marie](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Louis-Marie](https://community.forestadmin.com/u/Louis-Marie)
#### Post date: [August 16, 2022, 7:50am UTC](https://community.forestadmin.com/t/new-layout-refresh-problem/3456/24 "2022-08-16T07:50:50Z")

</div>

Hi team,

I can see that the problem still persist.  
I have multiple actions with the same issue, and if I had to change any action name, I would have to redesign all buttons and permissions in all environments, in all collections involved.

Would it be possible for you to fix this issue please?

Thanks in advance  
Louis-Marie

PS. I have updated my forest release, but nothing changed

```javascript
  "meta": {
    "liana": "forest-express-sequelize",
    "liana_version": "8.5.11",
    "stack": {
      "database_type": "multiple",
      "engine": "nodejs",
      "engine_version": "14.17.0",
      "orm_version": "5.22.3"
    }
  }

```

---

<div class="post-metadata">

### Author: ![Alban\_Bertolini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/alban_bertolini/32/1077_2.png) [@Alban\_Bertolini](https://community.forestadmin.com/u/Alban_Bertolini)
#### Post date: [August 16, 2022, 12:01pm UTC](https://community.forestadmin.com/t/new-layout-refresh-problem/3456/25 "2022-08-16T12:01:36Z")

</div>

Hello,  
Thank for the report, but unfortunately [this issue](https://sharing.clickup.com/t/h/1ht1ax9/X3ONUDXSLWKVXKK) will not be fixed because the [new agent](https://github.com/ForestAdmin/agent-nodejs) support it.

---

<div class="post-metadata">

### Author: ![arnaud](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud/32/32_2.png) [@arnaud](https://community.forestadmin.com/u/arnaud)
#### Post date: [August 16, 2022, 12:28pm UTC](https://community.forestadmin.com/t/new-layout-refresh-problem/3456/26 "2022-08-16T12:28:22Z")

</div>

Hi @Louis-Marie,

Sorry for this thorn in the side.

Unfortunately for all the Forest Admin users having this issue with Smart Actions, we decided not to spend our development team time on a fix to privilege new features for the future. We estimated that the workaround is an acceptable solution while waiting for the future of Forest Admin agents (ie the new [Node.js agent](https://docs.forestadmin.com/beta-developer-guide-agents-v2/) built from scratch this year) to propagate. Yet, we understand this can be painful to adapt the visibility and permissions while renaming an action.

The brand new agent solves this issue by design.  
But the migration, if you try it, won’t be an easy task, as the new agent introduces a different paradigm, and will very likely take a lot more time than renaming a few actions in you existing admin panel setup.

Don’t hesitate the reach out our Customer Support team if you intent to migrate 🙏

[Previous page](https://community.forestadmin.com/t/new-layout-refresh-problem/3456.md?page=1)
