Content
View differences
Updated by Christophe Bliard 10 months ago
### Steps to reproduce
1. Be an administrator
2. Go to Admin -> Colors
1. Either create a new color OR
2. modify an existing one
3. Provide a an erroneous code without the '#' sign in the "Hex code" input field:
1. use less than 6 hexadecimal characters like "#", "#AB", "#ABCD", or "#ABCDE" (note that "#ABC" is ok and is expanded to "#AABBCC")
2. add the leading "#" sign multiple times like "##ABCD" or "###ABC"
3. use non hexadecimal characters without the leading "#" like "ll" or "hello"
input
### What is the buggy behavior?
* 500
### What is the expected behavior?
1. Potentially, in the absence of a '#' sign, just assume it to be there and be robust about it.
### **Logs**
```text
app/models/colors/hex_color.rb:111 String#%
app/models/colors/hex_color.rb:111 Colors::HexColor#blend
app/models/colors/hex_color.rb:97 Colors::HexColor#darken
app/helpers/colors_helper.rb:130 ColorsHelper#icon_for_color
app/views/colors/_form.html.erb:46
app/views/colors/edit.html.erb:37
app/helpers/application_helper.rb:338 ApplicationHelper#labelled_tabular_form_for
app/views/colors/edit.html.erb:34
app/controllers/colors_controller.rb:86 ColorsController#update
```
https://appsignal.com/openproject-gmbh/sites/681379ae55b0b20ed3735994/exceptions/incidents/1078
1. Be an administrator
2. Go to Admin -> Colors
1. Either create a new color OR
2. modify an existing one
3. Provide a an erroneous code
1. use less than 6 hexadecimal characters like "#", "#AB", "#ABCD", or "#ABCDE" (note that "#ABC" is ok and is expanded to "#AABBCC")
2. add the leading "#" sign multiple times like "##ABCD" or "###ABC"
3. use non hexadecimal characters without the leading "#" like "ll" or "hello"
* 500
### What is the expected behavior?
1. Potentially, in the absence of a '#' sign, just assume it to be there and be robust about it.
### **Logs**
```text
app/models/colors/hex_color.rb:111 String#%
app/models/colors/hex_color.rb:111 Colors::HexColor#blend
app/models/colors/hex_color.rb:97 Colors::HexColor#darken
app/helpers/colors_helper.rb:130 ColorsHelper#icon_for_color
app/views/colors/_form.html.erb:46
app/views/colors/edit.html.erb:37
app/helpers/application_helper.rb:338 ApplicationHelper#labelled_tabular_form_for
app/views/colors/edit.html.erb:34
app/controllers/colors_controller.rb:86 ColorsController#update
```
https://appsignal.com/openproject-gmbh/sites/681379ae55b0b20ed3735994/exceptions/incidents/1078