PHP8 Warning for get_headers?

Created on 18 May 2023, over 1 year ago
Updated 14 June 2023, over 1 year ago

Problem/Motivation

I am getting the following warning in the logs. I am generating an XML export of nodes to inject elsewhere. Everything works on both ends, so I'm not sure what is the issue.

The feed is at https://reviews.ipmsusa.org/reviews_rss_feed2a.xml

Thx,
Eric

Warning: get_headers(): This function may only be used against URLs in views_rss_core_preprocess_item_enclosure() (line 357 of /home/ipmsusa3/public_html/drupal9/modules/contrib/views_rss/modules/views_rss_core/views_rss_core.inc)
#0 /home/ipmsusa3/public_html/drupal9/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'get_headers(): ...', '/home/ipmsusa3/...', 357)
#1 [internal function]: _drupal_error_handler(2, 'get_headers(): ...', '/home/ipmsusa3/...', 357)
#2 /home/ipmsusa3/public_html/drupal9/modules/contrib/views_rss/modules/views_rss_core/views_rss_core.inc(357): get_headers('https://reviews...', 1)
#3 /home/ipmsusa3/public_html/drupal9/modules/contrib/views_rss/src/Plugin/views/row/RssFields.php(278): views_rss_core_preprocess_item_enclosure(Array)
#4 /home/ipmsusa3/public_html/drupal9/modules/contrib/views_rss/src/Plugin/views/style/RssFields.php(477): Drupal\views_rss\Plugin\views\row\RssFields->render(Object(Drupal\views\ResultRow))
#5 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/Plugin/views/display/Feed.php(152): Drupal\views_rss\Plugin\views\style\RssFields->render(Array)
#6 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/ViewExecutable.php(1538): Drupal\views\Plugin\views\display\Feed->render()
#7 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/Plugin/views/display/Feed.php(128): Drupal\views\ViewExecutable->render()
#8 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/ViewExecutable.php(1635): Drupal\views\Plugin\views\display\Feed->execute()
#9 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/Element/View.php(81): Drupal\views\ViewExecutable->executeDisplay('feed_1', Array)
#10 [internal function]: Drupal\views\Element\View::preRenderViewElement(Array)
#11 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array(Array, Array)
#12 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
#13 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#14 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, true)
#15 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(148): Drupal\Core\Render\Renderer->render(Array, true)
#16 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#17 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(149): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#18 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/Plugin/views/display/Feed.php(109): Drupal\Core\Render\Renderer->renderRoot(Array)
#19 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/Routing/ViewPageController.php(56): Drupal\views\Plugin\views\display\Feed::buildResponse('reviews_rss_fee...', 'feed_1', Array)
#20 [internal function]: Drupal\views\Routing\ViewPageController->handle('reviews_rss_fee...', 'feed_1', Object(Drupal\Core\Routing\RouteMatch))
#21 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#22 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#23 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#24 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#25 /home/ipmsusa3/public_html/drupal9/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#26 /home/ipmsusa3/public_html/drupal9/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#27 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /home/ipmsusa3/public_html/drupal9/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /home/ipmsusa3/public_html/drupal9/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /home/ipmsusa3/public_html/drupal9/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /home/ipmsusa3/public_html/drupal9/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /home/ipmsusa3/public_html/drupal9/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /home/ipmsusa3/public_html/drupal9/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#38 {main}
πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States aitala

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

Comments & Activities

  • Issue created by @aitala
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Do you see this problem with the the newer rc3 release?

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA
  • πŸ‡ΊπŸ‡ΈUnited States aitala

    I will let you know now that I've updated to the 2.0 release version.

    Eric

  • πŸ‡ΊπŸ‡ΈUnited States aitala

    No, and in watchdog there is a warning that occurs previous to the one above..

    Note - I have tried to set allow_url_fopen to On but that does not seem to be working in php.ini

    Warning: get_headers(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in views_rss_core_preprocess_item_enclosure() (line 368 of /home/ipmsusa3/public_html/drupal9/modules/contrib/views_rss/modules/views_rss_core/views_rss_core.inc)
    #0 /home/ipmsusa3/public_html/drupal9/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'get_headers(): ...', '/home/ipmsusa3/...', 368)
    #1 [internal function]: _drupal_error_handler(2, 'get_headers(): ...', '/home/ipmsusa3/...', 368)
    #2 /home/ipmsusa3/public_html/drupal9/modules/contrib/views_rss/modules/views_rss_core/views_rss_core.inc(368): get_headers('https://reviews...', 1)
    #3 /home/ipmsusa3/public_html/drupal9/modules/contrib/views_rss/src/Plugin/views/row/RssFields.php(281): views_rss_core_preprocess_item_enclosure(Array)
    #4 /home/ipmsusa3/public_html/drupal9/modules/contrib/views_rss/src/Plugin/views/style/RssFields.php(483): Drupal\views_rss\Plugin\views\row\RssFields->render(Object(Drupal\views\ResultRow))
    #5 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/Plugin/views/display/Feed.php(152): Drupal\views_rss\Plugin\views\style\RssFields->render(Array)
    #6 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/ViewExecutable.php(1538): Drupal\views\Plugin\views\display\Feed->render()
    #7 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/Plugin/views/display/Feed.php(128): Drupal\views\ViewExecutable->render()
    #8 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/ViewExecutable.php(1635): Drupal\views\Plugin\views\display\Feed->execute()
    #9 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/Element/View.php(81): Drupal\views\ViewExecutable->executeDisplay('feed_1', Array)
    #10 [internal function]: Drupal\views\Element\View::preRenderViewElement(Array)
    #11 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array(Array, Array)
    #12 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
    #13 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
    #14 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, true)
    #15 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(148): Drupal\Core\Render\Renderer->render(Array, true)
    #16 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
    #17 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(149): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
    #18 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/Plugin/views/display/Feed.php(109): Drupal\Core\Render\Renderer->renderRoot(Array)
    #19 /home/ipmsusa3/public_html/drupal9/core/modules/views/src/Routing/ViewPageController.php(56): Drupal\views\Plugin\views\display\Feed::buildResponse('reviews_rss_fee...', 'feed_1', Array)
    #20 [internal function]: Drupal\views\Routing\ViewPageController->handle('reviews_rss_fee...', 'feed_1', Object(Drupal\Core\Routing\RouteMatch))
    #21 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
    #22 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #23 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
    #24 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
    #25 /home/ipmsusa3/public_html/drupal9/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #26 /home/ipmsusa3/public_html/drupal9/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
    #27 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #28 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #29 /home/ipmsusa3/public_html/drupal9/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #30 /home/ipmsusa3/public_html/drupal9/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #31 /home/ipmsusa3/public_html/drupal9/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #32 /home/ipmsusa3/public_html/drupal9/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #33 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #34 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #35 /home/ipmsusa3/public_html/drupal9/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #36 /home/ipmsusa3/public_html/drupal9/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #37 /home/ipmsusa3/public_html/drupal9/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
  • Status changed to Needs review over 1 year ago
  • Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    Waiting for branch to pass
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    This will take some debugging to work out what's going on.

    The field's rendered output is passed to get_headers(), and clearly something is being blocked.

    For now, let's try a bandaid.

  • 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
Production build 0.71.5 2024