kontent-ai / java-packages

Delivery Java SDK for Kontent.ai including examples for Spring, Gradle, Kotlin and Java Android app
https://kontent.ai/learn/tutorials/develop-apps/overview/?tech=java
MIT License
14 stars 28 forks source link

Link resolving of deeply nested content items #104

Closed b000za closed 3 years ago

b000za commented 4 years ago

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

petrsvihlik commented 4 years ago

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.

b000za commented 4 years ago

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

Simply007 commented 4 years ago

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:

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?

b000za commented 3 years ago

@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

Simply007 commented 3 years ago

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.