Warning when no vocabulary

Created on 2 June 2025, 4 days ago

Problem/Motivation

If the website does not have any vocabulary it triggers this warning:

ErrorException:
Warning: Undefined variable $names

  at modules/contrib/website_feedback/src/Form/SettingsForm.php:102
  at Drupal\website_feedback\Form\SettingsForm->buildForm(array('#attributes' => array('class' => array('website-feedback-settings')), 'type_enabled' => array('#type' => 'checkbox', '#title' => object(TranslatableMarkup), '#description' => object(TranslatableMarkup), '#default_value' => false), 'screenshot_enabled' => array('#type' => 'checkbox', '#title' => object(TranslatableMarkup), '#description' => object(TranslatableMarkup), '#default_value' => null), 'tags_enabled' => array('#type' => 'checkbox', '#title' => object(TranslatableMarkup), '#default_value' => 0)), object(FormState))

Steps to reproduce

Proposed resolution

$names should be defined before adding items to it.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇫🇷France prudloff Lille

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

Merge Requests

Comments & Activities

  • Issue created by @prudloff
  • Merge request !11Edit SettingsForm.php → (Open) created by prudloff
  • 🇧🇷Brazil igorgoncalves

    Hi @prudloff, thanks for you patch.

    Despite the fact your change its important to keep the code standards and prevent the issue, i couldn't reproduce the error.

    Can you update the IS with a quick step-by-step?

    I just tried with a Drupal 11 clean installation, the module version of this issue, and i deleted every vocabulary before test.

    Even though created the feedback as normal, without any warning on watchdog.

  • 🇮🇳India Kanchan Bhogade

    Hi
    I have manually tested MR 11 on Drupal Version 11.x and Issue is reproduced.
    Applied MR Successfully...

    with MR no error message when No vocabulary.

    Attaching Screenshot for reference

    RTBC+1

Production build 0.71.5 2024