avo icon indicating copy to clipboard operation
avo copied to clipboard

Resource fails to show when self.title is numeric

Open PadawanBreslau opened this issue 5 months ago • 0 comments

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:

  1. Create any resource
  2. Set self.title to point to a method returning numeric value
  3. Create def fields method with at least one field
  4. Open Show page of that resource
  5. 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)

PadawanBreslau avatar Aug 30 '24 10:08 PadawanBreslau