Skip to content
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

Plugin settings: bug on checkbox with default=true (frontend) #4106

Closed
JohnXLivingston opened this issue May 18, 2021 · 2 comments
Closed

Plugin settings: bug on checkbox with default=true (frontend) #4106

JohnXLivingston opened this issue May 18, 2021 · 2 comments
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor

Comments

@JohnXLivingston
Copy link
Contributor

Describe the current behavior

If a plugin has a checkbox settings with default value true, then the frontend always receive true as value.

I think that this is the line in cause:

result[r.name] = settings[r.name] || r.default || null

It should test if the key is in settings, not the value.

We had a similar bug on the backend ( #3838 ), here it is for the frontend.

Steps to reproduce:

  1. Use a plugin with a checkbox settings value defaulting to true
  2. Uncheck the checkbox
  3. The frontend gets true as value
  • PeerTube instance:
    • version: all version, including 3.2.0-rc1
@JohnXLivingston
Copy link
Contributor Author

Just made a PR to fix this.

@Chocobozzz Chocobozzz added Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor labels May 25, 2021
@Chocobozzz
Copy link
Owner

Fixed by #4107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor
Projects
None yet
Development

No branches or pull requests

2 participants