When the "iTunes Category" option in the "Podcast RSS Feed" settings is not set to a field -- that is, left to the default "None" -- the following undefined index error occurs when loading the feed.

Notice: Undefined index: value in Drupal\podcast\Plugin\views\style\Rss->processCategories() (line 277 of modules/contrib/podcast/src/Plugin/views/style/Rss.php).
Drupal\podcast\Plugin\views\style\Rss->processCategories(Array) (Line: 261)
Drupal\podcast\Plugin\views\style\Rss->getPodcastElements() (Line: 322)
Drupal\podcast\Plugin\views\style\Rss->render(Array) (Line: 106)
Drupal\views\Plugin\views\display\Feed->render() (Line: 1533)
Drupal\views\ViewExecutable->render() (Line: 82)
Drupal\views\Plugin\views\display\Feed->execute() (Line: 1630)
Drupal\views\ViewExecutable->executeDisplay('feed_2', Array) (Line: 77)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func(Array, Array) (Line: 378)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 139)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 140)
Drupal\Core\Render\Renderer->renderRoot(Array) (Line: 63)
Drupal\views\Plugin\views\display\Feed::buildResponse('sermons', 'feed_2', Array) (Line: 52)
Drupal\views\Routing\ViewPageController->handle('sermons', 'feed_2', Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Comments

TheLioness22 created an issue. See original summary.

thelioness22’s picture

StatusFileSize
new745 bytes

This should fix the undefined index error. It checks the itunes:category element and doesn't run the processCategories function unless the element is not empty since there are no categories to process when it is empty.

thelioness22’s picture

Status: Active » Needs review
e0ipso’s picture

Status: Needs review » Fixed

This looks good. Thanks for the patch.

  • e0ipso committed 0a7877a on 8.x-1.x authored by TheLioness22
    Issue #3029871 by TheLioness22, e0ipso: Undefined Index error when...

Status: Fixed » Closed (fixed)

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