TYPO3 CMS 8.7.27: Call to a member function getPackagePath() on null

Viewed 2014

After installing extensions in typo3 CMS 8.7.27, I got following error.. Seems like the ExtensionManagementUtility can't load the ah_contentapi.

enter image description here

This is my composer.json file in root (/var/www/html/typo3) for loading my extensions:

{
   "repositories":[
      {
         "type":"composer",
         "url":"https://composer.typo3.org/"
      },
      {
         "type":"package",
         "package":{
            "name":"Bm/ah-content-api",
            "version":"0.0.1",
            "type":"typo3-cms-extension",
            "source":{
               "url":"https://user@bitbucket.org/company/ah_config_typo3.git",
               "type":"git",
               "reference":"master"
            }
         }
      },
      {
         "type":"package",
         "package":{
            "name":"Bm/ah-contentelements",
            "version":"0.0.1",
            "type":"typo3-cms-extension",
            "source":{
               "url":"https://user@bitbucket.org/company/ah_contentelements_typo3.git",
               "type":"git",
               "reference":"master"
            }
         }
      }
   ],
   "name":"typo3/cms-base-distribution",
   "description":"TYPO3 CMS Base Distribution",
   "license":"GPL-2.0-or-later",
   "require":{
      "helhum/typo3-console":"^4.9.3 || ^5.2",
      "typo3/cms-about":"^8.7.10",
      "typo3/cms-belog":"^8.7.10",
      "typo3/cms-beuser":"^8.7.10",
      "typo3/cms-context-help":"^8.7.10",
      "typo3/cms-documentation":"^8.7.10",
      "typo3/cms-felogin":"^8.7.10",
      "typo3/cms-fluid-styled-content":"^8.7.10",
      "typo3/cms-form":"^8.7.10",
      "typo3/cms-func":"^8.7.10",
      "typo3/cms-impexp":"^8.7.10",
      "typo3/cms-info":"^8.7.10",
      "typo3/cms-info-pagetsconfig":"^8.7.10",
      "typo3/cms-rte-ckeditor":"^8.7.10",
      "typo3/cms-setup":"^8.7.10",
      "typo3/cms-sys-note":"^8.7.10",
      "typo3/cms-t3editor":"^8.7.10",
      "typo3/cms-tstemplate":"^8.7.10",
      "typo3/cms-viewpage":"^8.7.10",
      "typo3/cms-wizard-crpages":"^8.7.10",
      "typo3/cms-wizard-sortpages":"^8.7.10",
      "typo3/cms":"^8.7",
      "dmitryd/typo3-realurl":"2.*",
      "GridElementsTeam/Gridelements":"8.2.*",
      "clickstorm/cs_seo":"3.*",
      "Bm/ah-content-api":"0.0.1",
      "Bm/ah-contentelements":"0.0.1"
   },
   "scripts":{
      "typo3-cms-scripts":[
         "typo3cms install:fixfolderstructure",
         "typo3cms install:generatepackagestates"
      ],
      "post-autoload-dump":[
         "@typo3-cms-scripts"
      ]
   },
   "extra":{
      "typo3/cms":{
         "web-dir":"public"
      },
      "helhum/typo3-console":{
         "comment":"This option is not needed ay more for helhum/typo3-console 5.x",
         "install-extension-dummy":false
      }
   },
   "autoload":{
      "psr-4":{
         "Bm\\AhContentelements\\":"public/typo3conf/ext/ah_contentelements/Classes",
         "Bm\\AhContentapi\\":"public/typo3conf/ext/ah_content_api/Classes"
      }
   }
}

I already cleared cache in install tool at: 1. -> important actions -> clear all cache 2. -> clean up -> Clean typo3temp/ folder

piece from composer.lock:

{
    "_readme": [
        "This file locks the dependencies of your project to a known state",
        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
        "This file is @generated automatically"
    ],
    "content-hash": "954afd2318d54ec9b1dd0e4d7f9b445b",
    "packages": [
        {
            "name": "Bm/ah-content-api",
            "version": "0.0.1",
            "source": {
                "type": "git",
                "url": "https://stevenhippovibe@bitbucket.org/hippovibe/ah_config_typo3.git",
                "reference": "master"
            },
            "type": "typo3-cms-extension"
        },
        {
            "name": "Bm/ah-contentelements",
            "version": "0.0.1",
            "source": {
                "type": "git",
                "url": "https://stevenhippovibe@bitbucket.org/stevenhippovibe/ah_contentelements_typo3.git",
                "reference": "master"
            },
            "type": "typo3-cms-extension"
        },
4 Answers

The Error occurs when the extension folder name under typo3conf/ext/<folder_name> doesn't match extension key used in some places of the system (e.g. using EXT:your_extension_key/... syntax in TypoScript).

Changing folder name fixed similar problem for me.

Check the PHP version and try to change it from i.e. 7.4 to 7.3.

I once had this problem with an extension that should be compatible with PHP 7.4, but wasn't in real life. This solved the problem for me.

Question here is:

  • How did you update to 8.7.27 (which composer command was executed)
  • How does your composer.lock look like?
  • Do you use TYPO3 console or any other special composer plugins / CLI commands to e.g. generate PackageStates.php?

I just ran into the same error message under TYPO3 9.5.5.

Solution: Deinstall one TYPO3 extension after the other and try it out again. This will lead you to the extension which has an error. Most probably the error is inside of the file ext_localconf.php or ext_tables.php .

I got this error detail:

PHP Warning: Use of undefined constant FH_DEBUG_EXT - assumed 'FH_DEBUG_EXT' (this will throw an Error in a future version of PHP) in /var/www/html/global-extensions/ext/div2007/ext_localconf.php line 15

This has nothing to do with your error. But it can be that you have an error in one of your installed extensions or even in a backup of an extension, e.g. a folder named as extensionname.bak .

Also these recommendations can help: https://wiki.typo3.org/Exception/CMS/1476107295

Related