Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make level of relation resolving overwritable #101

Open
frastel opened this issue Feb 16, 2024 · 0 comments
Open

Make level of relation resolving overwritable #101

frastel opened this issue Feb 16, 2024 · 0 comments
Labels

Comments

@frastel
Copy link

frastel commented Feb 16, 2024

We have a data model with deep nested blocks and those blocks are used in rich text fields. The SDK stops at level 5 resolving relations however this limit is reached quite soon when a nestable block is used in a rich text field.

For getting things to work in our case we have to overwrite this limit.

As a workaround we are overwrite the Client quite ugly:

use Storyblok\Client as StoryblokClient;

class Client extends StoryblokClient
{
    public function enrichContent($data, $level = -2)
    {
        return parent::enrichContent($data, $level);
    }
}

Level does not start with the defaul 0 but in our case -2. At the end we have a limit of 6 (-2 up to 4).
isStopResolving is declared as private so we could not overwrite it directly.


Expected Behavior

Every relation in our rich text could be resolved.

  • Either we are able to set this level as parameter for the client
  • or the private method isStopResolving is made protected so we are able to overwrite it in a child class

Current Behavior

Deep nested relations are not resolved.

Steps to Reproduce

Create some content type with deep nested blocks and try to resolve all relations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants