ChoiceType array crash due to value name
See original GitHub issueI’ve run into this simultaneously in local and remote running instance of node-hue-api.
Error log is as follows,
Failed to get a remote connection using existing tokens. ApiError: Value ‘allreadytoinstall’ is not one of the allowed values [unknown,noupdates,transferring,anyreadytoinstall,allreadtoinstall,installing]
I’ve temporarily fixed this by adding the following to node_modules/node-hue-api/lib/types/ChoiceType.js
_convertToType(val) {
if (this.validValues.indexOf(val) > -1 || val === 'allreadytoinstall') {
return val;
} else {
throw new ApiError(`Value '${val}' is not one of the allowed values [${this.validValues}]`);
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Does anyone know why Symfony ChoiceType choices list ...
Does anyone know why Symfony ChoiceType choices list keep labels as the array keys rather than values? I looked but wasn't able to...
Read more >[Form] ChoiceType. Wrong render for duplicated choice values
Hello, $builder ->add('choice', ChoiceType::class, array( 'choices' => array( 'No Value' => 'value', 'Default Value' => 'value', ...
Read more >Symfony 2.3 - Part 7 - Choice and Entity Field Types - YouTube
The first 7 minutes or so is Choice field type using Arrays, then next 7-10 minutes are Choice using Entity field type, then...
Read more >[Solved]-Symfony Multiple choice on entity field-symfony
The correct usage of ChoiceType is to provide an array of choices, where the array key is the item's label and the array...
Read more >Debug, view array variable, VS crashes and restarts
Shortly after displaying the fly-out with the first 15 or so values in the array, all of Visual Studio restarts (the application debugging...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@peter-murray I can confirm that in both local and prod pulling the latest version from master repo works!
This has been fixed in
5.0.0-alpha.2
which is in the npm registry (or at least it has in my local testing).Due to this being a fix that will be required in the 4.x releases, I have just released this change in
4.0.6
as well.@danWithAD please verify when you get a chance