Closed (fixed)
Project:
Imagepin
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Apr 2021 at 21:38 UTC
Updated:
19 May 2021 at 06:34 UTC
Jump to comment: Most recent
I'm getting this error on a Drupal 9 site:
Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface
Set up the image media type to use pins, with the default text plugin.
This is hitting a core change to use class functions for element pre/post render for security reasons:
https://www.drupal.org/node/2966725
I created a new class called ImagepinRender and moved the pre/post process functions into it.
The other option is to implement this as an anonymous function. For consideration, this is called from a field preprocessor and the code is in imagepin.attach.inc.
Discuss solution and review patch.
none.
none.
none.
| Comment | File | Size | Author |
|---|---|---|---|
| imagepin-render-class.patch | 3.31 KB | mortona2k |
Comments
Comment #2
mortona2k commentedComment #4
nitesh624Comment #5
mxh commented@mortona2k Thank you for creating the issue and writing the patch.
@nitesh64 I appreciate your maintenance work on this module, but please do not commit patches which were not reviewed. Please make sure that only patches are being committed that were reviewed and at least fulfill coding formatting standards. The committed patch does not fulfill coding standards, e.g. class comment is missing and namespace usage is wrong. Please have a look at https://www.drupal.org/docs/develop/standards/coding-standards regards formatting rules.
Please correct standards and perform at least one review by another person.
Comment #6
nitesh624Thanks @mxh i haeing updated the branch and fix the coding standard issues. closing this.
https://git.drupalcode.org/project/imagepin/-/commit/ce91658b6207f4e5734...