View Issue Details

This issue affects 1 person(s).
 0
IDProjectCategoryView StatusLast Update
20866Bug reportsSurvey editingpublic2026-11-18 22:51
Reportermacwinnie Assigned To 
PrioritynoneSeveritycrash 
Status newResolutionopen 
Product Version7.11.x 
Summary20866: PHP warning: Undefined variable $showToolsMenu when editing default answer values
Description

Opening Edit default answer values fails with the following PHP warning:

Undefined variable $showToolsMenu
application/views/questionAdministration/partial/topbarBtns/editQuestionTopbarLeft_view.php:2

The stack trace points to QuestionAdministrationController::actionEditdefaultvalues() when rendering editQuestionTopbarLeft_view.php.

The view accesses $showToolsMenu without checking whether the variable is defined.

Steps To Reproduce

Steps to reproduce

  1. Open a survey and select a question that supports default answer values.
  2. Select Edit default answer values.
  3. Observe the PHP warning.

Cause

editQuestionTopbarLeft_view.php contains:

<?php if ($showToolsMenu) : ?>

However, $showToolsMenu is not defined in the data passed to the view by QuestionAdministrationController::actionEditdefaultvalues().

Confirmed workaround

Changing the condition to:

- <?php if ($showToolsMenu) : ?>
+ <?php if ($showToolsMenu ?? false) : ?>

resolves the warning.

Expected behavior

The default answer editor should open without PHP warnings.

Suggested fix

Ensure $showToolsMenu is initialized before rendering the view, or provide a fallback value when accessing it.

TagsNo tags attached.
Bug heat0
Complete LimeSurvey version number (& build)7.11.0+261116
I will donate to the project if issue is resolvedNo
BrowserFirefox and any other tested (Safari, Chrome, ...)
Database type & versionMariaDB 13.0.2
Server OS (if known)
Webserver software & version (if known)
PHP Version8.5.12
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2026-11-18 22:51 macwinnie New Issue