-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
luci-compat: CBI skip fields that do not satisfy depends #7463
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
If depends is not satisfied, the fvalue will be nil. Signed-off-by: Liangbin Lian <[email protected]>
3ac5741
to
4860e90
Compare
Please do not introduce new options into the legacy Lua cbi library. |
It's not an option, 'nilasempty' just a flag for internal usage, frontend pass nil when list empty. If we don't do this, how can we fix the luci bug? luci-app-dockerman is also affected by this bug. First switch "Remote Endpoint" to true, set "Remote Host" to "10.1.1.2", set "Remote Port" to "2375", save and apply; then switch "Remote Endpoint" to false. At this time, no matter how you set parameters, it will not be saved. |
The key point is that we should not check 'rmempty = false' when depends is not satisfied. |
Dockerman issue: #7508 |
In this case, I think docker's |
Maybe that can save. But when "Remote Endpoint" enabled, user must set "Remote Host" and "Remote Port", so |
why? |
When "Remote Endpoint" mode, "Remote Host" and "Remote Port" are all required. |
If depends is not satisfied, the fvalue will be nil.
@jow-
Signed-off-by: <[email protected]>
row (viagit commit --signoff
)<package name>: title
first line subject for packagesPKG_VERSION
in the MakefileA simple test code (
model/cbi/abc.lua
):Without this patch, when "role" changes from "fallback" to "main", save will failed with 'missing' error (
One or more required fields have no value!
).