Announcement

Collapse
No announcement yet.

(400) Field validation failure on comma decimal separator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • (400) Field validation failure on comma decimal separator

    Hi,

    after last update to 8.0.0 i got validation error 400 on posting through api if field type is currency and data that i am sending have comma "," as decimal separator",".
    'totalAmount' : '100,00' gets error 400.
    When I replaced comma with dot everything is ok

    [2023-09-12 12:52:04] WARNING: (400) Field validation failure; entityType: Tender, field: totalAmount, type: valid.; POST /Tender; line: 56, file: /var/www/crm/application/Espo/Core/Exceptions/BadRequest.php

    Sandro

  • #2
    Hi Sandro,

    It's not a bug. It's an expected behavior. You sent invalid value. You need to send float, integer, or a string with "." as a separator.
    Last edited by yuri; 09-12-2023, 02:37 PM.

    Comment


    • #3
      You should check your EspoCRM configuration here
      Administration > Parameters

      Click image for larger version

Name:	image.png
Views:	114
Size:	97.8 KB
ID:	97328‚Äč

      Comment


      • #4
        This parameter has nothing to do with API. It only affects representation.

        Comment


        • #5
          Originally posted by yuri View Post
          This parameter has nothing to do with API. It only affects representation.
          Okay, didn't know.
          My bad

          Comment


          • #6
            Originally posted by yuri View Post
            This parameter has nothing to do with API. It only affects representation.
            Ok Yuri, i am glad you are aware of the behavior, just wanted to say string with comma worked before update, its no more issue for me but could affect other user with middlewares.

            Comment


            • #7
              They might been working but not reliable. Now the problem is fixed with validation. Actually, it was added not in v8.0, but in v7.5.

              Comment

              Working...
              X