Skip to content

Bug: $name clobbered immediately after fetch in weathermap_map_settings_form() #209

@somethingwithproof

Description

@somethingwithproof

Summary

In weathermap-cacti-plugin-mgmt.php, weathermap_map_settings_form() fetches the map/group name then immediately overwrites it:

if ($mapid > 0) {
    $name = db_fetch_cell_prepared('SELECT titlecache FROM weathermap_maps WHERE id = ?', [$mapid]);
} else {
    $name = db_fetch_cell_prepared('SELECT name FROM weathermap_groups WHERE id = ?', [-$mapid]);
}

$name  = '';   // BUG: immediately overwrites the fetched value
$value = '';

The form header title always gets an empty string. Every map settings form is titled Map Setting [ Weathermap: ] regardless of which map is selected.

Fix

Remove the $name = ''; line, or rename the form-field variable to avoid collision.

Priority

Visual bug. Queue for Friday.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions