【问题标题】:TYPO3 CMS 8.7.27: Call to a member function getPackagePath() on nullTYPO3 CMS 8.7.27:在 null 上调用成员函数 getPackagePath()
【发布时间】:2019-11-07 02:08:08
【问题描述】:

在typo3 CMS 8.7.27 中安装扩展后,出现以下错误。似乎ExtensionManagementUtility 无法加载ah_contentapi。

这是我在根目录 (/var/www/html/typo3) 中的 composer.json 文件,用于加载我的扩展:

{
   "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"
      }
   }
}

我已经在安装工具中清除了缓存: 1. -> 重要动作 -> 清除所有缓存 2. -> 清理 -> 清理typo3temp/ 文件夹

来自 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"
        },

【问题讨论】:

    标签: typo3 typo3-8.x


    【解决方案1】:

    这里的问题是:

    • 您是如何更新到 8.7.27 的(执行了哪个 composer 命令)
    • 您的 composer.lock 是什么样子的?
    • 您是否使用 TYPO3 控制台或任何其他特殊的作曲家插件/CLI 命令来例如生成 PackageStates.php?

    【讨论】:

    • # sudo composer create-project typo3/cms-base-distribution typo3 ^8 & sudo composer require typo3/cms:^8.7 # 我从 composer.lock 中添加了一个片段。 # 它只是自动生成的?
    【解决方案2】:

    我刚刚在 TYPO3 9.5.5 下遇到了同样的错误消息。

    解决方案: 一个接一个地卸载一个 TYPO3 扩展,然后再试一次。这将引导您进入有错误的扩展程序。很可能错误在文件 ext_localconf.php 或 ext_tables.php 中。

    我收到了这个错误详情:

    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
    

    这与您的错误无关。但这可能是您在已安装的扩展程序之一中甚至在扩展程序的备份中出现错误,例如一个名为 extensionname.bak 的文件夹。

    这些建议也可以提供帮助: https://wiki.typo3.org/Exception/CMS/1476107295

    【讨论】:

      【解决方案3】:

      typo3conf/ext/<folder_name> 下的扩展文件夹名称与系统某些地方使用的扩展密钥不匹配(例如,在 TypoScript 中使用 EXT:your_extension_key/... 语法)时,会发生此错误。

      更改文件夹名称为我解决了类似的问题。

      【讨论】:

        【解决方案4】:

        检查 PHP 版本并尝试将其从 7.4 更改为 7.3。

        我曾经在一个应该与 PHP 7.4 兼容的扩展上遇到这个问题,但在现实生活中并没有。这解决了我的问题。

        【讨论】:

        • 一直降低到 PHP 7.2 有帮助,所以如果 7.3 没有帮助,请考虑 7.2
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-08-09
        • 1970-01-01
        • 2020-03-10
        • 2017-09-24
        • 2018-02-06
        • 2018-09-29
        • 2018-08-04
        相关资源
        最近更新 更多