Critical error in FieldType.php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ednt
    Member
    • May 2022
    • 63

    #1

    Critical error in FieldType.php

    Hi after updating to 9.3.1 I inspected the espocrm log and found:

    Code:
    CRITICAL: (0) Uncaught Exception ParseError: "syntax error, unexpected identifier "VARCHAR", expecting "="" at /var/www/clients/client1/web62/web/application/Espo/Core/ORM/Type/FieldType.php line 34 :: /var/www/clients/client1/web62/web/application/Espo/Core/ORM/Type/FieldType.php(34)
    The code is:

    Code:
    class FieldType
    {
    public const string VARCHAR = 'varchar';
    public const string BOOL = 'bool';
    When I check this in an online php sandbox I get the same error. https://onlinephp.io/

    The word string is the reason. It should look like:

    Code:
    class FieldType
    {
    public const VARCHAR = 'varchar';
    public const BOOL = 'bool';
    Is this correct ?

    Btw. it has nothing to do with 9.3.1
    It's a PHP problem.

    application/Espo/Core/ORM/Type/FieldType.php
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9692

    #2
    No. It's not correct. Your PHP version is lower than min supported.

    Comment

    • Ednt
      Member
      • May 2022
      • 63

      #3
      I run PHP 8.4 and in the sandbox you can choose any version you want, but the error is still available.
      PHP Version 8.4.18 Success

      Else I would got an error when I upgraded espocrm.
      Last edited by Ednt; Today, 10:41 AM.

      Comment

      • yuri
        EspoCRM product developer
        • Mar 2014
        • 9692

        #4
        I'm 99.99% percent sure that your PHP version was not up to date when the log error occurred. The web server PHP version may differ from the CLI version.

        Comment

        • Ednt
          Member
          • May 2022
          • 63

          #5
          If i use <?php like in the file, then I get the error.

          If I use <php I don't get the error.

          Comment

          • Ednt
            Member
            • May 2022
            • 63

            #6
            Click image for larger version

Name:	grafik.png
Views:	0
Size:	13.9 KB
ID:	125077

            In the mentioned php sandbox

            Comment

            • yuri
              EspoCRM product developer
              • Mar 2014
              • 9692

              #7
              This is just the frontend editor does not support the new syntax. It does not show errors in the output. I have to leave this topic as it takes my time.

              Comment

              • Ednt
                Member
                • May 2022
                • 63

                #8
                That you can save your time, if someone else run into the same problem:

                It was the start of cron.php which still used php 8.2

                Or should I not write this, because it takes my time?

                Comment

                Working...