Skip to content

Fix validation of inputs that aren't text - #21928

Merged
DeepDiver1975 merged 2 commits into
masterfrom
files-external-js-checkbox-fix
Jan 29, 2016
Merged

DeepDiver1975 merged 2 commits into
masterfrom
files-external-js-checkbox-fix

Conversation

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

This caused storages containing a checkbox input to not get checked when loading the settings, since .val() on a checkbox returns an empty string, and the JS thinks the storage is missing non-optional parameters. It also paves the way for better validation of other input types.

To test:

  1. Create a storage with some checkbox parameters (inception ownCloud is suitable)
  2. Configure storage and notice the green dot
  3. Reload the page, notice no status indicator of any kind
  4. With this PR, green dot appears again on page load

cc @PVince81 @icewind1991

@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified @butonic, @PVince81, @icewind1991 and @Xenopathic to be potential reviewers

Comment thread apps/files_external/js/settings.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var optional.
Else it's global 😱

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't done JS in a while 😆 Fixed now

@PVince81

Copy link
Copy Markdown
Contributor

Code looks good otherwise, a unit test would be nice 😄

@davitol

davitol commented Jan 29, 2016

Copy link
Copy Markdown
Contributor

👍 WFM

@RobinMcCorkell

Copy link
Copy Markdown
Contributor Author

@PVince81 Tests!

@PVince81

Copy link
Copy Markdown
Contributor

👍

DeepDiver1975 added a commit that referenced this pull request Jan 29, 2016
@DeepDiver1975
DeepDiver1975 merged commit e78be6f into master Jan 29, 2016
@DeepDiver1975
DeepDiver1975 deleted the files-external-js-checkbox-fix branch January 29, 2016 13:18
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants