panel
panel copied to clipboard
Boolean in variables can only be 1 or 0 and not longer TRUE or FALSE
Current Behavior
When you use in variables:
required|boolean
and as Value TRUE or FALSE, it will be everytime overwritten to 0 or 1. It's not langer possible to use TRUE or FALSE.
Looks like, this merged PR is the problem: https://github.com/pterodactyl/panel/commit/7d0d71baec8ccaeba5e9d63de203564d39d731b4
Expected Behavior
The field under validation must be able to be cast as a boolean. Accepted input are true, false, 1, 0, "1", and "0".
see: https://laravel.com/docs/8.x/validation#rule-boolean
Steps to Reproduce
- create a variable with
requiered|boolean
- add value
true
- try to save with value TRUE (or false)
Panel Version
1.7.0
Wings Version
1.6.1
Games and/or Eggs Affected
No response
Docker Image
No response
Error Logs
No response
Is there an existing issue for this?
- [X] I have searched the existing issues before opening this issue.
- [X] I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
- [X] I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.
Is your issue just that they store as 1/0
, or is there something receiving 1/0
in place of a boolean value?
True and false are considered invalid in the admin area if you want to save the values. You can only use 1 and 0.
In the user area, true and false are overwritten by 0 and 1 as soon as you use the switch. (In the admin area it becomes a 0 and 1, although the default value is false or true).
This problem isn't caused by my PR because it didn't touch the admin area. The problem is that the input field in the admin area converts the true/ false into a string. And a true/ false as string isn't accepted for a boolean.
please fix @matthewpi
A workaround: string|in:true,false
and it will show as a switch