Problem/Motivation

Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was styleswitcher_pre_render_html_tag. See https://www.drupal.org/node/2966725

Proposed resolution

Replace the styleswitcher_pre_render_html_tag() with a trusted callback. Preserve a backwards compatibility with supported core branches.

User interface changes

None.

API changes

New StyleswitcherElementInfoAlter class implementing RenderCallbackInterface with preRenderHtmlTag method.

Data model changes

None.

CommentFileSizeAuthor
#4 replace_a_pre_render-3135256-4.patch1.81 KBpingwin4eg

Comments

pingwin4eg created an issue. See original summary.

pingwin4eg’s picture

Title: Replace deprecated pre_render callback » Replace a pre_render callback with a closure
Issue summary: View changes
pingwin4eg’s picture

Title: Replace a pre_render callback with a closure » Replace a pre_render callback with a trusted callback
Issue summary: View changes
pingwin4eg’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.81 KB

  • pingwin4eg committed 756518e on 8.x-2.x
    Issue #3135256 by pingwin4eg: Replace a pre_render callback with a...
pingwin4eg’s picture

Status: Needs review » Fixed

Remaining fails are not related to pre_render callbacks. So I'm calling this fixed.

kristen pol’s picture

Issue tags: -D9 readiness +Drupal 9 compatibility

Remove outdated tag.

Status: Fixed » Closed (fixed)

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