Bug #6007
closedJavaScript error in firewall_nat_edit.php for protocols that do not use ports
100%
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?
Updated by Phillip Davis over 8 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
Updated by Anonymous over 8 years ago
- Category set to Web Interface
- Status changed from New to Assigned
- Assignee set to Anonymous
Updated by Anonymous over 8 years ago
- Status changed from Assigned to Feedback
- % Done changed from 0 to 100
Applied in changeset 47d6bf69f05aad42b7bea8f44811df9ea57b7d96.
Updated by Anonymous over 8 years ago
- Assignee changed from Anonymous to Phillip Davis
Updated by Phillip Davis over 8 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.