Locale must exist on linked records

Hi Dato,

We are having issues with linked records missing locales that exists in the base record. For example sv-SE exists in the base record but is missing from a linked record leading to errors when we render the page. It would be nice if you could support a easier way for us to find these types of error outside of building the page.

I don’t think a validator would solve it for us as that would force the creation of locales in the leaf nodes first and it could lead to a situation where locales could no longer be added to a record (if two records are linked to each other). I think a warning might be a good approach “this linked record is missing some locales present in this record”. The best i think would be an error on publish such as the one we get when a linked record is not published. If you do not want to change default behavior add this as a configuration option.

This issue occurs multiple times each week either as failed builds or as broken pages.

Hey @tim.nielsen I can see a couple things that can be done here:

  1. in theory if you need the locale to be present you could have a translated link field, so that you have to manually add a link for each locale. Extra manual work, which in your case might be too much with many locales, but it could be a general solution for others
  2. you could have a plugin on the link field that checks if linked records are missing the translations and show a warning to the editor
  3. on the frontend you could navigate the link, do the check at build time (or at an appropriate time) and issue a warning

What do you think?

The top part of the image is the base record it contains the locale sv-SE. sv-SE contains a link to the record sv_test which does not contain sv-SE. This will cause an issue for us and here we would like some kind of warning for the content editors that this is the case.

  1. What i described is true for localized and non-localized links. Even if the link is localized the record we are linking to might still be missing the locale.
  2. Sure but that would mean that we would have to develop, maintain and add that plugin to all link/links fields in all of our projects. We can solve it but this is a feature request i.e something we want added/changed on your end.
  3. The purpose of this feature requests is to move the responsibility to catch this from the front-end where it’s currently discovered to during content editing. The error is with the content and to make it easier for our content-editors to find these errors we require a change so that the issue is visualized.

Considering that you already have some validation during publishing for linked records it feels like this should be achievable.

image

If this is not something that is possible please let us know.

1 Like

Thank you for the feedback, it makes sense. Consider that with the new plugin SDK you can apply programmatically the plugin to link fields, so you might be able to add it automatically to all your links, if there’s a clear pattern. It might be faster than going in all the links and models to change the validation style. Or if you can apply a migration to do that, it might be similar to the plugin.

I’m mentioning the plugin simply because it can be independent from our development schedule, it might make sense for us to implement this, but it can take longer for you.