Error: Call to undefined function Drupal\views_rss\Plugin\views\style\_url()

Created on 12 March 2021, almost 4 years ago
Updated 10 July 2023, over 1 year ago

After configuring a Feed view with RSS - Fields etc., I just get this:

Error: Call to undefined function Drupal\views_rss\Plugin\views\style\_url() in Drupal\views_rss\Plugin\views\style\RssFields->attachTo() (regel 65 van /var/www/html/web/modules/contrib/views_rss/src/Plugin/views/style/RssFields.php)

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

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.

  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    Getting the same error with the new 2.0 stable release.

    It's a Search API index content powered View, which previously used core RSS Feed but both Format and Show for the feed display have been switched to Advanced RSS but i don't think that's relevantβ€” change the "Attach to:" settings to nothing, and the page display loads fine, switch it to Page and the page WSODs with this error:

    The website encountered an unexpected error. Please try again later.
    Error: Call to undefined function Drupal\views_rss\Plugin\views\style\_url() in Drupal\views_rss\Plugin\views\style\RssFields->attachTo() (line 65 of modules/contrib/views_rss/src/Plugin/views/style/RssFields.php).
    
    Drupal\views_rss\Plugin\views\style\RssFields->attachTo(Array, 'page_listing', Object, 'Articles') (Line: 340)
    Drupal\views\Plugin\views\display\Feed->attachTo(Object, 'page_listing', Array) (Line: 1733)
    Drupal\views\ViewExecutable->attachDisplays() (Line: 1333)
    Drupal\views\ViewExecutable->build() (Line: 392)
    Drupal\views\Plugin\views\display\PathPluginBase->execute() (Line: 196)
    Drupal\views\Plugin\views\display\Page->execute() (Line: 1635)
    Drupal\views\ViewExecutable->executeDisplay('page_listing', 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: 788)
    Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
    Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 243)
    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: 174)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->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: 191)
    Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
    Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
    Drupal\page_cache\StackMiddleware\PageCache->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: 718)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Thanks for letting me know, I'll look into this.

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    2 pass
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Copied some code from Drupal\views\Plugin\views\style\RSS:attachTo().

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    This is working in my local testing.

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Committed.

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

Production build 0.71.5 2024