Project

General

Profile

Bug #6007

JavaScript error in firewall_nat_edit.php for protocols that do not use ports

Added by Phillip Davis about 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Start date:
03/17/2016
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.3
Affected Architecture:

Description

1) Make a NAT Port Forward rule with some protocol that is not TCP or UDP - e.g. ICMP.
2) Turn on the developer stuff in your browser.
3) Edit the rule.
An error like this is reported:
Uncaught Error: cannot call methods on selectmenu prior to initialization; attempted to call method 'refresh'

It happens in function proto_change() on lines like:
$('#dstbeginport').prop("selectedIndex", 0).selectmenu('refresh');
$('#dstendport').prop("selectedIndex", 0).selectmenu('refresh');
$('#localbeginport').prop("selectedIndex", 0).selectmenu('refresh');

These lines are only executed if the protocol is not TCP or UDP.

This seems to result in odd stuff if you then select TCP as the protocol. The destination port from and to fields are displayed, but it shows from Other to Any.

Does someone know what was intended by that code, and what to do to get the selectmenu method to work?

Associated revisions

Revision 47d6bf69 (diff)
Added by Steve Beaver about 3 years ago

Fixed #6007
Initilize element before refreshing

History

#1 Updated by Phillip Davis about 3 years ago

Note: This happens in the existing firewall_rules_edit.php from master, and also just the same in the version where I have standardized the source advanced button - pull request https://github.com/pfsense/pfsense/pull/2758

#2 Updated by Steve Beaver about 3 years ago

  • Category set to Web Interface
  • Status changed from New to Assigned
  • Assignee set to Steve Beaver

#3 Updated by Steve Beaver about 3 years ago

  • Status changed from Assigned to Feedback
  • % Done changed from 0 to 100

#4 Updated by Steve Beaver about 3 years ago

  • Assignee changed from Steve Beaver to Phillip Davis

#5 Updated by Phillip Davis about 3 years ago

That was easily fixed - just remove the code altogether :)
I wasn't game to do that as I thought the code must have been there for a reason!

Works, thanks.

#6 Updated by Steve Beaver about 3 years ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF