Skip to content

fix(smb): repair WSD options script - #2791

Open
Junker der Provinz (junkerderprovinz) wants to merge 1 commit into
unraid:masterfrom
junkerderprovinz:fix/smb-wsd-script
Open

Junker der Provinz (junkerderprovinz) wants to merge 1 commit into
unraid:masterfrom
junkerderprovinz:fix/smb-wsd-script

Conversation

@junkerderprovinz

@junkerderprovinz Junker der Provinz (junkerderprovinz) commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2747

checkWSDSettings() on Settings > SMB is missing the closing parenthesis of its if, so the script block never parses and changing Enable WSD throws checkWSDSettings is not defined. The paren alone doesn't fix it: <?=($var['fsState']=="Started")?> prints 1 or nothing, so with the array stopped the line would render as && ) {.

The condition now renders true or false, 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 rendered disabled in 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, checkWSDSettings is 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 -l passes. The 7.0 to 7.3 branches carry the same line if you want a backport.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected Web Services Discovery settings so the option is enabled when WSD is set to “yes” and the array is not started.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f70d79f9-6169-419f-aa8e-b42218cb18ff
📥 Commits

Reviewing files that changed from the base of the PR and between 26eb1b5 and 02192c9.

📒 Files selected for processing: 1
  • emhttp/plugins/dynamix/SMBsettings.page

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The WSD2_OPT enablement condition now requires WSD to be set to “yes” and the array to be not started.

Changes

SMB WSD settings

Layer / File(s) Summary
WSD option condition
emhttp/plugins/dynamix/SMBsettings.page
The condition for enabling WSD2_OPT now checks that the array is not started.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 02192

The WSD options now follow the intended array and WSD states, and the script condition is syntactically complete. No actionable merge risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: repairing the WSD options script in SMB settings.
Linked Issues check Passed The change for [#2747] closes the if condition and removes the invalid PHP output. It emits true or false for the array state, so the script parses and checkWSDSettings() can update WSD2_OPT…
Out of Scope Changes check Passed The whole pull request changes one condition in emhttp/plugins/dynamix/SMBsettings.page. The change directly fixes the [#2747] syntax error and its WSD option behavior. No unrelated change is presen…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The change for [#2747] closes the if condition and removes the invalid PHP output. It emits true or false for the array state, so the script parses and checkWSDSettings() can update WSD2_OPT when USE_WSD changes. The condition keeps the options disabled while fsState is Started.

Full details: Out of Scope Changes check

Explanation

The whole pull request changes one condition in emhttp/plugins/dynamix/SMBsettings.page. The change directly fixes the [#2747] syntax error and its WSD option behavior. No unrelated change is present.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the WSD switch,
The array’s state is checked as well.
When WSD is yes and arrays rest,
The option wakes at this request.
Then hops away, content and blessed.

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.10.16.2010
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2791/webgui-pr-2791.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix/SMBsettings.page

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2791, or run:

plugin remove webgui-pr-2791

🤖 This comment is automatically generated and will be updated with each new push to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WSD checkbox handler: JS syntax error on Settings → SMB page

1 participant