Project

General

Profile

Bug #5121

interfaces.php - Wireless Antenna Selection should default to "Default"

Added by Jim Pingle over 1 year ago. Updated 12 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
Start date:
09/11/2015
Due date:
% Done:

100%

Spent time:
Affected version:
2.3
Affected Architecture:
All

Description

The Transmit and Receive antenna options under "Antenna Settings" are defaulting to "Auto" on bootstrap rather than the "Default" option which was the default on 2.2.x.

Associated revisions

Revision c71c434b
Added by Steve Beaver over 1 year ago

Fixed #5121 Antennas now default to 'Default'

Revision 87c59979
Added by Steve Beaver over 1 year ago

Fixed #5121
Obscure PHP issue with mixed variable types.

Revision 6dee9957
Added by Steve Beaver over 1 year ago

Fixed #5121
Antenna section removed per JimT

History

#1 Updated by Steve Beaver over 1 year ago

  • Status changed from Confirmed to Feedback
  • Assignee changed from Steve Beaver to Jim Pingle

Antenna controls now default to "Default"

#2 Updated by Steve Beaver over 1 year ago

  • % Done changed from 0 to 100

#3 Updated by Jim Pingle over 1 year ago

  • Status changed from Feedback to Assigned
  • Assignee changed from Jim Pingle to Steve Beaver

On a fully up-to-date system with a wireless card, it's still defaulting to Auto for me.

#4 Updated by Steve Beaver over 1 year ago

  • Status changed from Assigned to Feedback
  • Assignee changed from Steve Beaver to Jim Pingle

If $pconfig['txantenna'] is not set, the selector value is null, and the null array element is 'Default'.

Would you check your config file please and see what valueis in there for rxantenna and txantenna? Blank, '0' or '1' ?

Thanks

Code:

if (isset($wl_sysctl["{$wl_sysctl_prefix}.txantenna"])) {
$group->add(new Form_Select(
'txantenna',
null,
(isset($pconfig['txantenna'])) ? $pconfig['txantenna']:'',
['' => 'Default', '0' => 'Auto', '1' => '#1', '2' => '#2']
))->setHelp('Transmit antenna');

#5 Updated by Jim Pingle over 1 year ago

  • Status changed from Feedback to Assigned
  • Assignee changed from Jim Pingle to Steve Beaver

Before adding the interface it did not exist in config.xml at all and there was nothing in in the wireless tag.

Assigning the interface, it appears like so:

                <opt2>
                        <descr><![CDATA[OPT2]]></descr>
                        <if>ath0</if>
                        <wireless/>
                </opt2>

And farther down in the config:

 <wireless/>

Navigating to Interfaces > OPT2 it shows Auto for antennas.

Inspecting the source shows both options marked selected:

<select id="txantenna" class="form-control" name="txantenna">
    <option selected="" value="">Default</option>
    <option selected="" value="0">Auto</option>
    <option value="1">#1</option>
    <option value="2">#2</option>
</select>

#6 Updated by Steve Beaver over 1 year ago

  • Status changed from Assigned to Feedback
  • Assignee changed from Steve Beaver to Jim Pingle

Thanks for your help in finding this!

It was an obscure issue in the Select.class.php framework file wherein '' == '0' if one is a string and the other an int.

#8 Updated by Jim Pingle over 1 year ago

  • Status changed from Feedback to Assigned
  • Assignee changed from Jim Pingle to Steve Beaver

It defaults to "default" now, but when manually set to auto, it still marks default as selected. I know PHP is pretty quirky when it comes to use of empty() on "" vs 0, 0 even as a string all evaluate to true. Might be related.

#9 Updated by Chris Buechler over 1 year ago

Jim T. said the antenna selection is of no use anyway, so should just remove it, then this can be closed out.

#10 Updated by Jim Pingle over 1 year ago

That's probably a good move, though if the framework has a general issue with the scenario it may still come back to haunt us in other areas.

#11 Updated by Steve Beaver over 1 year ago

  • Status changed from Assigned to Feedback
  • Assignee changed from Steve Beaver to Jim Pingle

Fixed and removed.

#13 Updated by Jim Pingle over 1 year ago

  • Status changed from Feedback to Assigned
  • Assignee changed from Jim Pingle to Steve Beaver
  • % Done changed from 100 to 0

The Antenna selection options are still showing up here for me when synced to master.

#14 Updated by Steve Beaver over 1 year ago

  • Status changed from Assigned to Feedback
  • Assignee changed from Steve Beaver to Jim Pingle

Mia culpa

if(ANTENNAS) condition corrected

#15 Updated by Steve Beaver over 1 year ago

  • % Done changed from 0 to 100

#16 Updated by Jim Pingle over 1 year ago

  • Status changed from Feedback to Resolved

Gone now. Thanks!

#17 Updated by Chris Buechler 12 months ago

  • Affected version changed from All to 2.3

Also available in: Atom PDF