Announcement

Collapse
No announcement yet.

Entering Number in filed 'phoneNumber' creates Error 400

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

  • Entering Number in filed 'phoneNumber' creates Error 400

    [ EspoCRM v. 7.2.7 ]

    I get an error 400, when entering any number into field 'phoneNumber':
    Click image for larger version

Name:	grafik.png
Views:	346
Size:	27.7 KB
ID:	85841
    Cannot figure out, what the error clould cause. I did not have this problem with v. 7.2.6.

    Kind regards

  • #2
    Hi,

    can you check these file :

    https://github.com/espocrm/espocrm/b...eType.php#L119

    https://github.com/espocrm/espocrm/b...eType.php#L188

    and look metadata

    https://github.com/espocrm/espocrm/b...terns.json#L27

    can you too change function :

    https://github.com/espocrm/espocrm/b...eType.php#L178

    to

    private function isValidNumber(string $number): bool

    maybe
    Last edited by item; 12-02-2022, 11:17 AM.

    Comment


    • #3
      Check Administration > Entity Manager > {Your Entity} > Fields > Phone > Type List. Whether the value "Buro" is listed in the defined list.

      Comment


      • #4
        Hi yuri,
        looks like this (seems, there is a space in front of "Büro" in the first line of typelist -> problem?):
        Click image for larger version

Name:	grafik.png
Views:	257
Size:	34.9 KB
ID:	85850

        Comment


        • #5
          Change the Default Value (Standardtyp) to "Office" and then Save.

          Thing is that you have the default value set to "Buro" that is not a valid option. It's a translation.

          I also recommend to update all values in the phone_number table from Buro to Office.
          Last edited by yuri; 12-02-2022, 02:19 PM.

          Comment


          • #6
            Originally posted by yuri View Post
            Change the Default Value (Standardtyp) to "Office" and then Save.

            Thing is that you have the default value set to "Buro" that is not a valid option. It's a translation.

            I also recommend to update all values in the phone_number table from Buro to Office.
            Translation: OMG, will I ever get it right? Thanks for the hint!
            Change type "Büro" to "Office": It's because of the Umlauts? I will have to delete my "Büro" types then and set new "Office" ones. I will loose data, won't I?

            Comment


            • #7
              It's because you had the Büro (not translation) option before and removed it after. But it did not remove it from the Default Value (the bug we had before). So now you had Office as a valid value, but Büro as a default value (not valid value).

              You won't loose any data if you run an SQL query updating Büro => Office.
              Last edited by yuri; 12-02-2022, 03:18 PM.

              Comment


              • #8
                I changed setting to this:

                Click image for larger version

Name:	grafik.png
Views:	250
Size:	26.1 KB
ID:	85858
                Save, clear cache, rebuild. Still it does not work - error as before.

                Comment


                • #9
                  What value you are saving?

                  Comment


                  • #10
                    e.g.:
                    123
                    +49 (0)841/9323457
                    084316478

                    Comment


                    • #11
                      What type.

                      Comment


                      • #12
                        Fieldtype? Field "phoneNumber" is of type "Telefon". Hm, even if in preferences I set language to english, it says "Telefon". Should be "PhoneNumber" ...
                        Last edited by agri; 12-02-2022, 03:40 PM.

                        Comment


                        • #13
                          Type is phone type. What phone type value you tried to save.

                          Comment


                          • #14
                            Originally posted by yuri View Post
                            Type is phone type. What phone type value you tried to save.
                            Well, just what you would type in into a phone number field. Such as just numbers or an combination like "+49 (0) 1234/6789". Should be no problem, referring to "phoneNumberLoose" in \var\www\html\custom\Espo\Custom\Resources\metadat a\app\regExpPatterns.json
                            Click image for larger version

Name:	grafik.png
Views:	222
Size:	29.0 KB
ID:	85868
                            I must appologize, if I didn't get you right!​

                            Comment


                            • #15
                              I didn't know that you have a custom regular expression. Such details needs to be provided initially.

                              There was no any change in v7.2.7.

                              Comment

                              Working...
                              X