Error 500 Call to undefined function entity\attribute()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chrisjames
    Junior Member
    • May 2024
    • 11

    Error 500 Call to undefined function entity\attribute()

    Update from 8.4.2 to 9.0.1

    Hi All,

    I'm not able to update via GUI update. Getting Error 500
    Call to undefined function entity\attribute()

    I don't have CLI so this is the only way to update.

    Any ideas? looking forward to 9.0.1.

    Chris
  • yuri
    Member
    • Mar 2014
    • 8610

    #2
    Hi Chris,

    In you custom PHP code, there's "entity\attribute()" usage which is invalid. You might have added it by a mistake in the past. You need to remove that code.
    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

    • chrisjames
      Junior Member
      • May 2024
      • 11

      #3
      Hi Yuri,

      thank you for your reply. I found some unused code as you said and removed it, then tried another upgrade. I tried upgrading and it failed again, with the error null, then tried again and the application crashed leaving a blank screen. Currently running a restoration from backup. Hope it works \o/

      If you've got any other ideas then I'd be happy to hear them:-)

      Comment

      • item
        Active Community Member
        • Mar 2017
        • 1497

        #4
        Hi,
        i have same issue but with cli .. i don't know how you can do with without cli but my solution was this :

        - download upragde file
        - add this echo in the upgrade EspoCRM-upgrade-8.4.2-to-9.0.0/scripts/BeforeUpgrade.php

        PHP Code:
        private function loadFromDir(string $dir, array $skipPathRegexList): void
            {
                $directory = new \RecursiveDirectoryIterator($dir);
                $fullTree = new \RecursiveIteratorIterator($directory);
                $phpFiles = new \RegexIterator($fullTree, '/^.+\.php$/i', \RecursiveRegexIterator::GET_MATCH);
        
                foreach ($phpFiles as $path) {
                    $file = $path[0];
                    echo $file ."\n";     // I ADD THIS
                    if ($this->toSkip($file, $skipPathRegexList)) {
                        continue;
                    }
        
                    require_once($file);
                }
            } 
        
        And then make upgrade with this modified file

        So you can view witch files. (in cli.. .i don't know with GUI)
        And after correct the bad file, i have upgrade with the "original upgrade zip" of espoCrm.

        Hope you can find a solution with GUI.
        Last edited by item; 01-27-2025, 09:04 PM.
        If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

        Comment

        • yuri
          Member
          • Mar 2014
          • 8610

          #5
          There must be something in the log.
          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

          • chrisjames
            Junior Member
            • May 2024
            • 11

            #6
            item Thank you for this. I'll have a go.

            yuri The log hasn't much. I've restored from backup, but now adding new calendar entries returns an error500. I can't think what this might be. None of the permissions have changed on files. Any thoughts? I'm happy to investigate - I love getting to know it better. Its a great application.

            Comment

            • chrisjames
              Junior Member
              • May 2024
              • 11

              #7
              Hi All,
              I think I've fixed this. Some files hadn't transferred across during the restoration. I've rechecked and uploaded missed files. So far most of the system is working - I'll investigate the bugs which may have been there prior to this latest issue.

              I will update the thread if I manage a successful update base on item 's advice.

              Anon

              Comment

              Working...