Warning: Undefined array key

Created on 26 April 2024, 8 months ago
Updated 24 June 2024, 6 months ago

Problem/Motivation

These errors are thrown within the Podcast RSS Feed view in the modal when i open the Format Settings. I should add, that this is not preventing the view from being rendered correctly. I actually have no issues to publish my podcast with the resulting feed, but I am concerned about the stability of the feed because of those errors.

Warning: Undefined array key "language" in Drupal\podcast\Plugin\views\style\Rss->buildOptionsForm() (Zeile 158 in /app/web/modules/contrib/podcast/src/Plugin/views/style/Rss.php).:
array (29)
Called from <ROOT>/modules/contrib/podcast/src/Plugin/views/style/Rss.php:158 [backtrace_error_handler()]

Warning: Undefined array key "#type" in Drupal\podcast\Plugin\views\style\Rss->buildOptionsForm() (Zeile 255 in /app/web/modules/contrib/podcast/src/Plugin/views/style/Rss.php).:
array (29)
Called from <ROOT>/modules/contrib/podcast/src/Plugin/views/style/Rss.php:255 [backtrace_error_handler()]

Warning: Undefined array key "#type" in Drupal\podcast\Plugin\views\style\Rss->buildOptionsForm() (Zeile 258 in /app/web/modules/contrib/podcast/src/Plugin/views/style/Rss.php).:
array (29)
Called from <ROOT>/modules/contrib/podcast/src/Plugin/views/style/Rss.php:258 [backtrace_error_handler()]

Warning: Undefined array key "#default_value" in Drupal\select_or_other\Element\ElementBase::addSelectField() (Zeile 130 in /app/web/modules/contrib/select_or_other/src/Element/ElementBase.php).:
array (31)
Called from <ROOT>/modules/contrib/select_or_other/src/Element/ElementBase.php:130 [backtrace_error_handler()]

Warning: Undefined array key "#other_option" in Drupal\select_or_other\Element\ElementBase::addSelectField() (Zeile 141 in /app/web/modules/contrib/select_or_other/src/Element/ElementBase.php).:
array (31)
Called from <ROOT>/modules/contrib/select_or_other/src/Element/ElementBase.php:141 [backtrace_error_handler()]

Additionally I get two different errors in the preview section of the view:

Warning: Trying to access array offset on value of type null in {closure}() (Zeile 73 in /app/web/modules/contrib/podcast/podcast.module).:
array (39)
Called from <ROOT>/modules/contrib/podcast/podcast.module:73 [backtrace_error_handler()]

Warning: Trying to access array offset on value of type null in {closure}() (Zeile 77 in /app/web/modules/contrib/podcast/podcast.module).:
array (39)
Called from <ROOT>/modules/contrib/podcast/podcast.module:77 [backtrace_error_handler()]

Steps to reproduce

Not sure. I have a lot of fields and also a couple of relations, so I am able to connect my episodes content type to my podcast content type, so I am not sure if this might play a role in producing the problem I described.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

1.9

Component

Code

Created by

🇩🇪Germany bobjoe

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

Merge Requests

Comments & Activities

  • Issue created by @bobjoe
  • Assigned to abhishek_virasat
  • Merge request !13fix the issue → (Open) created by abhishek_virasat
  • Issue was unassigned.
  • Status changed to Needs review 8 months ago
  • 🇮🇳India abhishek_virasat

    @bobjoe, I have fixed the issue and created MR. please review it once

  • 🇩🇪Germany bobjoe

    @abhishek_gupta1 thank you! I just tested it and it seems as all the error messages are gone. Except the one regarding the select_or_other module:

    Warning: Undefined array key "#other_option" in Drupal\select_or_other\Element\ElementBase::addSelectField() (Zeile 141 in /app/web/modules/contrib/select_or_other/src/Element/ElementBase.php).:
    Called from <ROOT>/modules/contrib/select_or_other/src/Element/ElementBase.php:141 [backtrace_error_handler()]

    I saw you created a patch for it already here: https://www.drupal.org/project/podcast/issues/3437811 🐛 Warnings related to the copyright field Needs work but I couldn't install it on top of your branch that fixes the specific issue on this page right here. I tried to install it on top of the current stable release of the podcast module, which worked, buts didn't solve the error message for me.

  • 🇺🇸United States Kasey_MK

    MR 13 doesn't fix these errors on my installation:

    Warning: Trying to access array offset on value of type null in {closure}() (Zeile 73 in /app/web/modules/contrib/podcast/podcast.module).:
    array (39)
    Called from <ROOT>/modules/contrib/podcast/podcast.module:73 [backtrace_error_handler()]
    
    Warning: Trying to access array offset on value of type null in {closure}() (Zeile 77 in /app/web/modules/contrib/podcast/podcast.module).:
    array (39)
    Called from <ROOT>/modules/contrib/podcast/podcast.module:77 [backtrace_error_handler()]

    If I put a check for $value around that section, the errors go away, but I'm not familiar enough with the code to really understand what that does.

    +    if ($value) {
    +      if ($content = $value['value']) {
    +        $out .= sprintf('<%s>%s</%s>', $value['key'], $content, $value['key']);
    +      }
    +      else {
    +        $out .= sprintf('<%s />', $value['key']);
    +      }
    +      return $out;
         }
    -    return $out;

    Thanks for your work!

Production build 0.71.5 2024