Repository navigation
fix(smb): repair WSD options script - #2791
Junker der Provinz (junkerderprovinz) wants to merge 1 commit into
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
No actionable comments were generated in the recent review. WalkthroughThe WSD2_OPT enablement condition now requires WSD to be set to “yes” and the array to be not started. ChangesSMB WSD settings
Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk:
|
🔧 PR Test Plugin AvailableA test plugin has been generated for this PR that includes the modified files. Version: 📥 Installation Instructions:Install via Unraid Web UI:
Alternative: Direct Download
|
02192c9 to
1454dc7
Compare
Fixes #2747
checkWSDSettings()on Settings > SMB is missing the closing parenthesis of itsif, so the script block never parses and changing Enable WSD throwscheckWSDSettings is not defined. The paren alone doesn't fix it:<?=($var['fsState']=="Started")?>prints1or nothing, so with the array stopped the line would render as&& ) {.The condition now renders
trueorfalse, written the same way as in DateTime.page and DeviceInfo.page (? 'true' : 'false'). I also flipped it to!="Started". #1928 was meant to keep the WSD options disabled while the array runs, and the field is already rendereddisabledin that state, so=="Started"would switch it back on. Dropping the condition, as the issue suggests, would bring back the old behaviour. One side effect: with the array stopped and Enable WSD set to No, the options field is disabled again, the way it was before #1928.Tested on 7.3.2 with the array started: no console error,
checkWSDSettingsis defined, and the options field stays disabled when Enable WSD is toggled. I couldn't stop the array on that box, so the stopped case is only checked by rendering the block with PHP for both states and parsing the output with node.php -lpasses. The 7.0 to 7.3 branches carry the same line if you want a backport.Summary by CodeRabbit