Project

General

Profile

Bug #7082

pkg_edit.php - impossible to use default_value with rowhelperfield

Added by Kill Bill 4 months ago. Updated 4 months ago.

Status:
New
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Start date:
01/05/2017
Due date:
% Done:

0%

Affected version:
2.3.x
Affected Architecture:
All

Description

I mean, things like:

<rowhelperfield>
    <fielddescr>Test select</fielddescr>
    <fieldname>testselect</fieldname>
    <type>select</type>
    <options>
        <option><name>One</name><value>one</value></option>
        <option><name>Two</name><value>two</value></option>
    </options>
    <default_value>one</default_value>
</rowhelperfield>

or

<rowhelperfield>
    <fielddescr>Test input</fielddescr>
    <fieldname>testinput</fieldname>
    <type>input</type>
    <default_value>Test default value</default_value>
</rowhelperfield>

The <default_value> tag does nothing.

History

#1 Updated by Steve Beaver 4 months ago

I will investigate.

I presume the desired functionality is that if the element has no current (stored) value, the default_value should be used to set it?

#2 Updated by Kill Bill 4 months ago

I'm kinda unsure that the <default_value> works like that even for non-rowhelperfield fields. :-) What I see in packages is lots of things like

$foo = $somepkgconfig['foo'] ?: 'default';

But with fields outside rowhelper, the value is printed and gets used on save. You cannot get any such thing with <rowhelperfield> at the moment. Also, it's a useful hint to show the default value without adding additional descriptions - plus, the <description> tags are a no go here as well, see https://redmine.pfsense.org/issues/5673#note-5

Also available in: Atom PDF