Problem/Motivation

In views, even though I'm stripping all of the HTML, freelinking is trying to process links in a RTE field we're displaying.

I get this error

Warning: Drupal\freelinking\Plugin\Filter\Freelinking::Drupal\freelinking\Plugin\Filter\{closure}(): Argument #1 ($result) must be passed by reference, value given in Drupal\freelinking\Plugin\Filter\Freelinking->extractAllowedPlugins() (line 344 of modules/contrib/freelinking/src/Plugin/Filter/Freelinking.php).
Drupal\freelinking\Plugin\Filter\Freelinking->extractAllowedPlugins(Array) (Line: 255)
Drupal\freelinking\Plugin\Filter\Freelinking->process('An [[nodetitle:online service]] that provides identity and access management for Microsoft-hosted services such as [[nodetitle:Microsoft 365 Enterprise]] and for customer and third-party applications; licensed via [[nodetitle:User SL]]s (Subscription Licenses). <strong>See</strong> [[nodetitle:Azure Active Directory]] for in-depth entry.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 772)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 363)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 934)
Drupal\views\Plugin\views\field\EntityField->render_item(0, Array) (Line: 1170)
Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object) (Line: 238)
template_preprocess_views_view_field(Array, 'views_view_field', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('views_view_field', Array) (Line: 422)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 1747)
Drupal\views\Plugin\views\field\FieldPluginBase->theme(Object) (Line: 779)
Drupal\views\Plugin\views\style\StylePluginBase->elementPreRenderRow(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 772)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 363)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 718)
Drupal\views\Plugin\views\style\StylePluginBase->renderFields(Array) (Line: 584)
Drupal\views\Plugin\views\style\StylePluginBase->renderGrouping(Array, Array, 1) (Line: 475)
Drupal\views\Plugin\views\style\StylePluginBase->render(Array) (Line: 2170)
Drupal\views\Plugin\views\display\DisplayPluginBase->render() (Line: 1533)
Drupal\views\ViewExecutable->render() (Line: 199)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1630)
Drupal\views\ViewExecutable->executeDisplay('page_1', Array) (Line: 81)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 772)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 363)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 241)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 42)
Drupal\force_password_change\Service\ForcePasswordChangeRedirectMiddleware->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 265)
Drupal\shield\ShieldMiddleware->bypass(Object, 1, 1) (Line: 132)
Drupal\shield\ShieldMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

This is causing a 20+ second load time on views where 100 rows of results are being generated...

1. the pass by reference error should be fixed.

2. why is my VIEW still trying to render this? Even though I've set this to TRIMMED and STRIP HTML.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alphex created an issue. See original summary.

mradcliffe’s picture

Version: 8.x-3.2 » 8.x-3.x-dev

To answer your views question, Views, for a field like a body field, uses the views "field" plugin, which will use the Field Formatter configured in the Node type's "Field Display" tab. After that, the trim / strip html functionality in views is done. That is something that unfortunately cannot be dealt with without finding a Field Formatter that would change the text format on-the-fly. I don't know if there's a contrib. module that offers that functionality, but that would be the most performance rather than using Views post-rendering functionality.

It looks like both 8.x-3.x and 4.0.x branches need the PHP deprecation fixes so I'll focus on resolving those in this issue..

mradcliffe’s picture

Status: Active » Needs review

  • mradcliffe committed e8fe2a3 on 8.x-3.x
    Issue #3293175 by mradcliffe: Passed by Reference Errors
    

  • mradcliffe committed 3f7ca14 on 4.0.x
    Issue #3293175 by mradcliffe: Passed by Reference Errors
    
mradcliffe’s picture

Version: 8.x-3.x-dev » 4.0.x-dev
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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