Warning on line 29 of modules/contrib/quicktabs/src/Plugin/TabRenderer/QuickTabs.php

Created on 10 February 2022, almost 3 years ago
Updated 30 March 2023, over 1 year ago

I'm getting the following warning when creating a new Quick Tabs instance:

Warning: Trying to access array offset on value of type null in Drupal\quicktabs\Plugin\TabRenderer\QuickTabs->optionsForm() (line 29 of modules/contrib/quicktabs/src/Plugin/TabRenderer/QuickTabs.php).
Drupal\quicktabs\Plugin\TabRenderer\QuickTabs->optionsForm(Object) (Line: 112)

The attached patch changes line 29 from:

$options = $instance->getOptions()['quick_tabs'];

..to:

$options = !empty($instance->getOptions()['quick_tabs']) ? $instance->getOptions()['quick_tabs'] : [];

...which I believe should work no differently as far as the rest of the function is concerned.

πŸ› Bug report
Status

Closed: outdated

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States wrd-oaitsd

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.

  • πŸ‡¨πŸ‡¦Canada nickdickinsonwilde Victoria, BC (T'So-uke lands)

    Looks to have been fixed in other work.
    Relevant line has been replaced with
    $options = $instance_options['quick_tabs'] ?? []; which does the same but cleaner IMO.

Production build 0.71.5 2024