kontent-ai/java-packages

Link resolving of deeply nested content items

b000za opened this issue · 5 comments

What went wrong?

Problem with resolving links in deeply nested content items. Imagine following situation:

Content item which has linked another content item and this item has as well linked another content item. In the last content item is a rich text where a text or word is linked to a content item (see screenshot).

Screenshot_1

So the structure would be the following:

content item -> content item -> content item -> rich text with linked text

When I inspect (debug) the rich text element that contains the link I can see that the link is there, the only problem is that the resolver doesn't notice this.

In the application a ContentLinkUrlResolver is used to resolve links. This works fine for structures that are not so deeply nested, such as: content item -> content item -> rich text with linked text (this is resolved just fine).

Repro steps

  1. Create a content item
  2. Link another content item in the previous one
  3. Link another content item in the previous one as well
  4. In the last content item link a content item to a text/word (see screenshot above)

Expected behavior

Links are resolved of any depth

Hi @b000za ,
thanks for reporting the issue. We'll investigate it. If you have any code that you could share that could help us reproduce the issue, that would be really helpful and would speed up the resolution.

Hey @petrsvihlik, is there any update on this issue?

Hello @b000za ,

I will try to reproduce the issue, but I have a couple of questions to be able to set up the environment first:

What version of the SDK you are using?

Could you specify more the content model?

Let's say there are items Item1 -> Item2 -> Item3 -> Item4

The links between Item1, Item2 and Item3 are modeled as:

  • kontent items (meaning Item2 and Item3 are non-reusable content components)
    • linked as inline linked items
    • linked as inline link
  • kontent component (meaning Item2 and Item3 are content items)

It would be very helpful to create a project with the model you are describing, so that we have a same input for investigation.

Could share a code snipper how you are loading the content and how you define the resolvers?

Do you use Model Generator/Strongly models?

@Simply007

Hey, sorry for the late response. We recently switched to version 4.0.0-beta.6 and it seems that it works now! :)

thx

I have just released v4 https://github.com/Kentico/kontent-java-packages/releases/tag/4.0.0, there should be no difference in comparison with 4.0.0-beta.6, so feel free to make an upgrade.

Thanks for the notification @b000za.
I will close this issue for now.