On drupal 9.0.1, I added a new entity browser display to a view. When I try to configure something, the following ajax error occurs:

The website encountered an unexpected error. Please try again later.Drupal\Core\Security\UntrustedCallbackException: Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was Drupal\entity_browser\Plugin\views\display\EntityBrowser::preRenderAddFieldsetMarkup. See https://www.drupal.org/node/2966725 in Drupal\Core\Render\Renderer->doTrustedCallback() (line 96 of core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

adinac created an issue. See original summary.

adinac’s picture

Danny Englander’s picture

I ran into this same issue. The patch fixed the issue.

Danny Englander’s picture

Status: Active » Reviewed & tested by the community

  • oknate committed 6592dd2 on 8.x-2.x authored by adinac
    Issue #3154079 by adinac: Drupal 9 - Error when configuring an entity...
oknate’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

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

Chris Matthews’s picture

@oknate, would it possible to tag Entity Browser 8.x-2.6 for the 6592dd2 commit on 8.x-2.x?

a.dmitriiev’s picture

+1 for the new version

Grimreaper’s picture

Hello,

I have just encountered this issue too when testing an issue with Entity Browser for another contrib module.

Big +1 for a new release.

Web-Beest’s picture

FileSize
3.16 KB

I know this is a closed issue, but wouldn't it be better to call the parent function and add the trusted functions?

'preRenderAddFieldsetMarkup' is one of the trusted callbacks from PluginBase, so no need to add it to the list again.

Web-Beest’s picture

FileSize
641 bytes

Patched wrong version, sorry.

immoreel’s picture

Patch from #2 works, patch from #12 couldn't be applied

jnettik’s picture

Can confirm that the dev version of the module fixes this. Any chance of a tagged release anytime soon?

phjou’s picture

I encountered the same issue, it took me a while to find out that it was this issue because it is closed/fixed.

PCate’s picture

I encountered the same issue, it took me a while to find out that it was this issue because it is closed/fixed.

Same here, ran into this issue today. Patch #2 fixed the issue. Can we get a new tagged release?

oknate’s picture

I have tagged a new release with this fix in it. https://www.drupal.org/project/entity_browser/releases/8.x-2.6

jlicht’s picture

Rerolled the patch for the 1.x branch