Project

General

Profile

Actions

Bug #6007

closed

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

Added by Phillip Davis almost 9 years ago. Updated almost 9 years ago.

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

100%

Estimated time:
Plus Target Version:
Release Notes:
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?

Actions #1

Updated by Phillip Davis almost 9 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

Actions #2

Updated by Anonymous almost 9 years ago

  • Category set to Web Interface
  • Status changed from New to Assigned
  • Assignee set to Anonymous
Actions #3

Updated by Anonymous almost 9 years ago

  • Status changed from Assigned to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by Anonymous almost 9 years ago

  • Assignee changed from Anonymous to Phillip Davis
Actions #5

Updated by Phillip Davis almost 9 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.

Actions #6

Updated by Anonymous almost 9 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF