Regression issue : smart field references not populated

Hi @Guillaume_Cisco,

Sorry for my late answer.

In order to reproduce the issue, please be sure to reload your page after hiding the column in the list, because otherwise, it is in cache somewhere, and the summary view is then displaying it without any issue.

Here is additional information.

Furthermore, just to be sure and clarify a point when you are saying " kyc and card are not displayed in the summary view", you mean you can see the id with a link but not the value with a link?

Yes, that’s it. The ID are displayed (as illustrated in the video) instead of the references.

By looking at your smart fields, I assume it is following this previous topic, right?

Yes, but only for other smart fields. The smart fields used as references in Forest collections are defined using the standard get() method (see an example below).

Can you confirm me you are using afterFind hook for creating your smart fields card and kyc ?

For some of them only. Not for those used as references.

As I can see, it seems to work well with the subscription field. Is it a smart field? How is it declared?

It works with subscription only because I kept this field displayed in the list before accessing the summary view.
When hiding the subscription field in the list, and reloading Forest, then I have the same problem on it.

Would that be possible for you to share with us your models, routes if overridden, and smart field declaration?
It will help us getting as closer as possible of your configuration.

Sure.
The GET /users route was overridden before my tests, but I commented it before the video to be sure that it was not due to my custom code.
For information: users → cards / users → kyc / users → subscriptions are all defined in the same way for my native relationships:

db.users.hasOne(db.cards);
db.users.hasOne(db.subscriptions);
db.users.hasOne(db.kyc);

All the 3 smart fields used as the reference field in Forest admin in their related collections are defined using the same get() method.
So, I will illustrate the subscriptions collection smart field only.

    field: 'Subscription',
    type: 'String',
    get: (subscript) => {
      if (subscript.updated_at && subscript.premium && subscript.monthly) {
        return 'Premium monthly';
      } else if (subscript.updated_at && subscript.premium) {
        return 'Premium yearly';
      } else if (subscript.updated_at) {
        return 'Free';
      } else {
        return 'Not yet chosen';
      }
    },

Hoping this will help.

Best regards