ALinks causes security exception after Drupal 8.8

Created on 18 September 2020, over 4 years ago
Updated 1 February 2024, 11 months ago

Problem/Motivation

ALinks needs to implement TrustedCallbackInterface.

Steps to reproduce

When displaying a page with ALink content on a Drupal 8.9 or 9.0 site, the #post_render is blocked because ALinkPostRenderer does not implement the TrustedCallbackInterface documented in https://drupal.org/node/2966725.

Drupal\Core\Security\UntrustedCallbackException: Render #post_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was Drupal\alinks\AlinkPostRenderer::postRender. See https://www.drupal.org/node/2966725 in Drupal\Core\Render\Renderer->doTrustedCallback() (line 96 of core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php)

https://www.drupal.org/project/alinks/issues/3171893#

Proposed resolution

Implement that interface.

Remaining tasks

User interface changes

None;

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇷France fgm Paris, France

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024