File tree Expand file tree Collapse file tree
src/opnsense/mvc/app/models/OPNsense/Firewall Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 <Required >Y</Required >
1212 <!-- Intentionally no default set as its applied by actionPostLoadingEvent() -->
1313 </sequence >
14- <enabled type =" .\DNatEnabledField" volatile =" true" />
1514 <!-- legacy disabled flag for compatibility -->
1615 <disabled type =" BooleanField" />
16+ <enabled type =" .\DNatEnabledField" volatile =" true" />
1717 <nordr type =" BooleanField" />
1818 <interface type =" InterfaceField" >
1919 <Multiple >Y</Multiple >
Original file line number Diff line number Diff line change @@ -38,25 +38,17 @@ public function setValue($value)
3838 return ;
3939 }
4040 $ value = (string )$ value ;
41- $ parent = $ this ->getParentNode ();
4241 // Set disabled value opposite of enabled value for legacy compatibility.
43- if ($ parent !== null && isset ($ parent ->disabled ) && $ value !== '' ) {
44- $ parent ->disabled = $ value === '1 ' ? '0 ' : '1 ' ;
45- }
42+ $ this ->getParentNode ()->disabled = $ value === '1 ' ? '0 ' : '1 ' ;
4643 return parent ::setValue ($ value );
4744 }
4845
4946 public function getValue (): string
5047 {
51- $ value = parent ::getValue ();
52- $ isNotInitialized = $ this ->internalInitialValue === false ;
53- // Get value from disabled flag if enabled does not have a value set.
54- if ($ isNotInitialized || $ value === '' ) {
55- $ parent = $ this ->getParentNode ();
56- if ($ parent !== null && isset ($ parent ->disabled )) {
57- return (string )$ parent ->disabled === '1 ' ? '0 ' : '1 ' ;
58- }
48+ $ parent = $ this ->getParentNode ();
49+ if ($ parent !== null && isset ($ parent ->disabled )) {
50+ return (string )$ parent ->disabled === '1 ' ? '0 ' : '1 ' ;
5951 }
60- return $ value ;
52+ return parent :: getValue () ;
6153 }
6254}
You can’t perform that action at this time.
0 commit comments