Getting this from the TocBuilder:

Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use renderPlain()/renderRoot() or #lazy_builder/#pre_render instead.

Issue fork toc_api-2905420

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mikey_p created an issue. See original summary.

vladimiraus’s picture

Status: Needs review » Needs work

How can we test it?

DrupalHack’s picture

StatusFileSize
new959 bytes

Patch stopped applying after 10.2 upgrade.
Some edge cases of our custom TOC implementation would error on save. updating as a legacy patch.

albert volkman’s picture

Version: 8.x-1.0-beta1 » 8.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.15 KB

One missed instance of the renderPlain() method.

ericgsmith made their first commit to this issue’s fork.

albert volkman’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
albert volkman’s picture

StatusFileSize
new1.16 KB

Re-rolled patch for 2.0.x branch since I don't have access to the merge branch.

joseph.olstad’s picture

Status: Needs review » Closed (outdated)

This is already fixed in toc_api 2.0.x

Please upgrade to 2.0.x

This will not be fixed in 8.x-1.x

joseph.olstad’s picture

Assigned: Unassigned » joseph.olstad
Status: Closed (outdated) » Active

Actually, still looking into this, maybe was too hasty.

  • joseph.olstad committed 4352f8fd on 2.0.x
    Issue #2905420 by albert volkman, ericgsmith, mikey_p, joseph.olstad,...
joseph.olstad’s picture

Status: Active » Fixed
joseph.olstad’s picture

Assigned: joseph.olstad » Unassigned
joseph.olstad’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

joseph.olstad’s picture

Please upgrade to 2.0.1-rc1 and let me know how it works out for you. I won't tag 2.0.1 until I get at least some statistics on usage or some kind of feedback.

ericgsmith’s picture

@joseph.olstad the original MR was using renderPlain which would now be renderInIsolation. What was the reason to change to renderRoot?

This has introduced additional errors - see #3553887: Libraries not loaded since renderRoot is used instead of render

edit - since this is old I think maybe it should be reverted and a new issue opened? I'm not actually sure renderInIsolation is correct either - perhaps https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...

joseph.olstad’s picture

@ericgsmith, there was a push for Drupal 11 compatibility and bugfixes and maybe this one shouldn't have gone in.

I'll look at 3553887 thanks

joseph.olstad’s picture

Status: Closed (fixed) » Needs work

FYI, this was reverted, it caused problems as documented above.

joseph.olstad’s picture

Status: Needs work » Closed (outdated)

I'm going to close this issue since a lot of things have changed since 2017 and if this still is an issue I think someone should create a new issue for it.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.