When configuring an entity_browser view in drupal 9 I could not open the views display settings modal. In watchdog appeared errors like the following:

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

The solution was to alter one function in class Drupal\entity_browser\Plugin\views\display\EntityBrowser:

Original was:

  public static function trustedCallbacks() {
      return ['postRender', 'elementPreRender'];
  }

Changed it into:

  public static function trustedCallbacks() {
      return ['postRender', 'elementPreRender', 'preRenderAddFieldsetMarkup'];
  }

Sorry - I don't know how to create a patch ...

Sunny greetings from Austria
Anschinsan

Comments

anschinsan created an issue. See original summary.

olivier.br’s picture

Status: Active » Fixed

This has been fixed on dev version.

Status: Fixed » Closed (fixed)

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

juburin’s picture

Hey is there a plan when we can see a new release with this?

callinmullaney’s picture

We are also experiencing this issue and can confirm it's fixed in the dev version. However, we didn't want to use a dev version of a module on a production site and couldn't wait for another release given it's been nearly a year since the last one. For anyone using 8.x-2.5 you can include the attached patch in your composer file.

nicolas s.’s picture