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
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | error-with-untrustedcallbackexception-3160482-5.patch | 550 bytes | callinmullaney |
Comments
Comment #2
olivier.br commentedThis has been fixed on dev version.
Comment #4
juburin commentedHey is there a plan when we can see a new release with this?
Comment #5
callinmullaney commentedWe 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.
Comment #6
nicolas s. commentedThis fix existing on #3154079