Entering Number in filed 'phoneNumber' creates Error 400

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • agri
    Member
    • Mar 2021
    • 89

    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:	489
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
  • item
    Active Community Member
    • Mar 2017
    • 1484

    #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.
    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment

    • yuri
      Member
      • Mar 2014
      • 8521

      #3
      Check Administration > Entity Manager > {Your Entity} > Fields > Phone > Type List. Whether the value "Buro" is listed in the defined list.
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      • agri
        Member
        • Mar 2021
        • 89

        #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:	379
Size:	34.9 KB
ID:	85850

        Comment

        • yuri
          Member
          • Mar 2014
          • 8521

          #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.
          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

          Comment

          • agri
            Member
            • Mar 2021
            • 89

            #6
            Originally posted by yuri
            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

            • yuri
              Member
              • Mar 2014
              • 8521

              #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.
              If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

              Comment

              • agri
                Member
                • Mar 2021
                • 89

                #8
                I changed setting to this:

                Click image for larger version

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

                Comment

                • yuri
                  Member
                  • Mar 2014
                  • 8521

                  #9
                  What value you are saving?
                  If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                  Comment

                  • agri
                    Member
                    • Mar 2021
                    • 89

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

                    Comment

                    • yuri
                      Member
                      • Mar 2014
                      • 8521

                      #11
                      What type.
                      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                      Comment

                      • agri
                        Member
                        • Mar 2021
                        • 89

                        #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

                        • yuri
                          Member
                          • Mar 2014
                          • 8521

                          #13
                          Type is phone type. What phone type value you tried to save.
                          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                          Comment

                          • agri
                            Member
                            • Mar 2021
                            • 89

                            #14
                            Originally posted by yuri
                            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:	348
Size:	29.0 KB
ID:	85868
                            I must appologize, if I didn't get you right!​

                            Comment

                            • yuri
                              Member
                              • Mar 2014
                              • 8521

                              #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.
                              If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                              Comment

                              Working...