avo
avo copied to clipboard
Resource fails to show when self.title is numeric
Describe the bug
After updating to 3.11.10 I noticed some of my resources to fail with Internal Server Error 500 on Show action. After investigation I figured it out that it happened only in resources with self.title set as a number (including numeric id). Changing this is not a problem, but investigating what happened was problematic.
Steps to Reproduce
Steps to reproduce the behaviour:
- Create any resource
- Set self.title to point to a method returning numeric value
- Create
def fields
method with at least one field - Open Show page of that resource
- Something Went Wrong
Expected behaviour & Actual behaviour
Return numeric id as a string or a nice error and a note in documentation that is has to be a string vs Something Went Wrong page and 500 error
Models and resource files
System configuration
Avo version: 3.11.10
Rails version: 7.2
Ruby version: 3.2.2
License type:
- [ ] Community
- [x] Pro
- [ ] Advanced
Are you using Avo monkey patches, overriding views or view components?
- [ ] Yes. If so, please post code samples.
- [x] No
Screenshots or screen recordings
Additional context
Impact
- [x] High impact (It made my app broken - until I figured out the problem source)
- [ ] Medium impact (I'm annoyed, but I'll live.)
- [ ] Low impact (It's really a tiny thing that I could live with.)
Urgency
- [ ] High urgency (I can't continue development without it.)
- [ ] Medium urgency (I found a workaround, but I'd love to have it fixed.)
- [x] Low urgency (It can wait. I just wanted you to know about it as others may have same issue)