Problem/Motivation

Call to renderRoot in LeafletMarker and LeafletMap is causing an error 500.

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /views/ajax
StatusText: Internal Server Error
ResponseText: {"message":"A fatal error occurred: A stray renderRoot() invocation is causing bubbling of attached assets to break."}

Proposed resolution

Replace calls to renderRoot with render.

Comments

jorgegc created an issue. See original summary.

jorgegc’s picture

Status: Active » Needs review
StatusFileSize
new1.72 KB
itamair’s picture

StatusFileSize
new1.73 KB

renderPlain should work even better.
Amended patch attached. Please @jorgegc review and confirm this solves your issue, the I will commit to dev.

jorgegc’s picture

Status: Needs review » Reviewed & tested by the community

Hi @itamair, I can confirm that renderPlain works as well. If you don't mind me asking, why did you opt to use renderPlain instead of render?

itamair’s picture

because in some circumstances we had problems also with render:

LogicException: Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use renderPlain()/renderRoot() or #lazy_builder/#pre_render instead. in Drupal\Core\Render\Renderer->doRender()

Have a look to this issue, for instance: https://www.drupal.org/project/geofield_map/issues/2940295

renderPlain() seems to be the most robust way to go in our normal cases ... that seem not to arise matters, so far.

Please give me your counter opinion if you think that render instead is the best solution (and why ... if possibile).
Otherwise please confirm that I might commit to dev with renderPlain

itamair’s picture

  • itamair committed aae1e68 on 8.x-1.x authored by jorgegc
    Issue #2958295 by jorgegc, itamair: Views AJAX returning HTTP 500 due to...
itamair’s picture

Committed to dev ...

itamair’s picture

Status: Reviewed & tested by the community » Fixed
jorgegc’s picture

Thanks @itamair and sorry I could get back to you earlier.

Status: Fixed » Closed (fixed)

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