Reference inputs in multi-environment spaces (enterprise)

I started using environments in Builder–it’s great! But there’s a small problem when using references.

When you set a reference as a content input, you can restrict the content items to a particular model. Doing so sets the modelId field in the content item JSON:

{
  "@type": "@builder.io/core:Field",
  "name": "author",
  "type": "reference",
  "modelId": "475f4f8ac9ea4afb9c5991be7a18781c",
  ...
}

Once you switch environments, however, the model-based validation no longer works because your old model id has been prefixed with the environment key. You can set the model again, like so:

{
  "@type": "@builder.io/core:Field",
  "name": "author",
  "type": "reference",
  "modelId": "9e1c9500f106432dbfa7f5743e4868e1_475f4f8ac9ea4afb9c5991be7a18781c",
  ...
}

but then the validation is broken in other environments.

Is there a way around this bug and will it be fixed soon?

Hi @ersin,

We hope you’re doing well!

I’ve received your request and looking into this. Will get back to you asap!

Hey @ersin,

  • Can you confirm that 9e1c9500f106432dbfa7f5743e4868e1 is the environment where the issue is happening?
  • Also could you also confirm the contentId or the modelId where is this referenced from and this issue is happening?

Hi @ersin, hope you’re doing well!

Since we haven’t heard back from you, so just following up with you on this!

Looking forward to your response, it would be a great help for our dev team to deep dive into this!