Referenced field shows id, not referenced field

Feature(s) impacted

Reference field

  • When a user is referenced, I want to see the field… Name

Observed behaviour

It used to work, not anymore: it shows the _id

Hello @arnaudambro,

I just try on my side and couldn’t reproduce. :confused:

  • Does it stop working on a specific collection ? On all collection ?
  • Can you double check the Referenced field configuration of the user collection ?
  • Can you share your Project Name / Agent Version ?

Best regards,
Morgan

Hi Morgan

→ It’s not on every field, neither on every collection. Not even on every environment
→ I double checked and I think the referenced field is ok
→ Project Name: Walkie
→ Agent version:
“meta”: {
“liana”: “forest-express-mongoose”,
“liana_version”: “8.4.3”,
“stack”: {
“database_type”: “MongoDB”,
“engine”: “nodejs”,
“engine_version”: “12.18.3”,
“orm_version”: “5.13.12”
}
}

Would be a great help if you find out !

one more things: it’s only in list view.
when I click on an item, then it’s properly displayed.
but on a list view, the id is displayed instead of the references field

Hello @arnaudambro,

Thanks for sharing all those information. We will try to reproduce this behavior.

Just a last question, can you check the widget you’re using on this field ?

Thanks in advance for your time. :pray:

Kind regards,
Morgan


do you mean this ?

1 Like

That’s it. So this is the buggy one ?

So the child field should show the referenced field defined in the referenced collection.

Can you share the your schema/mongoose definition for this collection ? (We should see that child is a Ref to something)

Kind regards,
Morgan

On which environment are you experiencing it ?

I’m trying to gaver as much information as we can to reproduce the issue on our side. :pray:

Regards,
Morgan

They are all buggy actually, not only this one.
It was not buggy a few weeks ago, but it’s buggy now, only on list view, not on details/summary view.
It’s not even buggy in Development (local) mode, only in Production.
The schema never changed, it looks like


module.exports = (mongoose, Mongoose) => {
  const Schema = Mongoose.Schema({
    user: { type: Mongoose.Schema.Types.ObjectId, ref: 'User' },
    child: { type: Mongoose.Schema.Types.ObjectId, ref: 'Child' },

I tried to Copy layout configuration from development to production, but it didn’t change a thing

Hey @arnaudambro,

I just check your config. Your production uses the forest-express-mongoose 8.5.0 and your development uses forest-express-mongoose 8.4.3.

Could you try to use the same version on both environments ?

Could you push the latest forest-admin-schema (generated in development) to your production environment ? I’m wondering if it could have been changed by someone that introduced the issue.

Let me know if it resolve the issue.

Kind regards,
Morgan

Hi Morgan

We forced the 8.4.3 everywhere, and now it works good.
Is it a problem with 8.5.0 ? Or is it just incompatibility with config files between different versions ?

1 Like

Hey @arnaudambro,

Perfect. :ok_hand:

You should always have an forest-admin-schema generated with the same forest-express-mongoose version.

The basic workflow is you need to work on development environment, once your happy with what you have added you push your changes to production (using you favorite version control system a.k.a git). This way your code base, dependencies and the forest-admin-schema (only generated in development) are always coherent.

Let me know if you need more information. Maybe our documentation lacks some information on this topic (actually we are working on making it better with a brand new version).

Kind regards,
Morgan