Project

General

Profile

Actions

Bug #53311

closed

t3lib_extMgm::extPath() no longer works in ext_localconf.php

Added by Dmitry Dulepov about 11 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extension Manager
Target version:
Start date:
2013-11-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

Using this function with $_EXTKEY no longer works after the introduction of PackageManager and throws an exception that the current extension is not loaded. Stack trace:

ExtensionManagementUtility::extPath(), 103
ext_localconf_XXX.php, line 1185
SimpleFileBackend->requireOnce(), 362
PhpFrontEnd->requireOnce(), 82
ExtensionManagementUtility::loadExtLocalconf(), 1418
Bootstrap->loadAdditionalConfigurationFromExtensions(), 680
....

Code from the extension multicolumn that causes this:

define('PATH_tx_multicolumn', t3lib_extMgm::extPath('multicolumn'));

This worked always in TYPO3 and many extensions use this to get paths to their internal resources. This must be fixed before the release of 6.2.

Actions #1

Updated by Dmitry Dulepov about 11 years ago

Same with EXT:news:

<?php

if (!defined ('TYPO3_MODE')) {
    die ('Access denied.');
}

    // Extension manager configuration
require_once(t3lib_extMgm::extPath('news') . 'Classes/Utility/EmConfiguration.php');
$configuration = Tx_News_Utility_EmConfiguration::getSettings();

EXT:phpunit:

<?php
if (!defined('TYPO3_MODE')) {
    die ('Access denied.');
}

$composerAutoloadFile = t3lib_extMgm::extPath('phpunit') . 'Composer/vendor/autoload.php';

/** @var $extensionSettingsService Tx_Phpunit_Service_ExtensionSettingsService */
$extensionSettingsService = t3lib_div::makeInstance('Tx_Phpunit_Service_ExtensionSettingsService');
$composerPhpUnitPath = t3lib_extMgm::extPath('phpunit') . 'Composer/vendor/phpunit/phpunit/';
if ($extensionSettingsService->hasString('composerpath')) {
    $userComposerPath = rtrim(t3lib_div::fixWindowsFilePath($extensionSettingsService->getAsString('composerpath')), '/');
    if (is_dir($userComposerPath . '/vendor/') && is_file($userComposerPath . '/vendor/autoload.php')) {
        if (set_include_path($userComposerPath . PATH_SEPARATOR . get_include_path()) !== FALSE) {
            $composerAutoloadFile = $userComposerPath . '/vendor/autoload.php';
        }
    }
}
unset($extensionSettingsService);

EXT:recycler (sysext!!!):

<?php
if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
$TYPO3_CONF_VARS['BE']['AJAX']['RecyclerAjaxController::init'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Classes/Controller/class.tx_recycler_controller_ajax.php:TYPO3\\CMS\\Recycler\\Controller\\RecyclerAjaxController->init';

EXT:rtehtmlarea:

require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'ext_emconf.php';

and so on.

Result on the page:

Fatal error: Uncaught exception 'BadFunctionCallException' with message 'TYPO3 Fatal Error: Extension key "rtehtmlarea" is NOT loaded!' in /*****/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php on line 104

BadFunctionCallException: TYPO3 Fatal Error: Extension key "rtehtmlarea" is NOT loaded! in /*****/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php on line 104

Call Stack:
    0.0004     629464   1. {main}() /*****/index.php:0
    0.0057    1089744   2. require() /*****/index.php:41
    0.0710    3554344   3. TYPO3\CMS\Core\Core\Bootstrap->loadTypo3LoadedExtAndExtLocalconf(TRUE) /*****/typo3/sysext/cms/tslib/index_ts.php:41
    0.0710    3554344   4. TYPO3\CMS\Core\Core\Bootstrap->loadAdditionalConfigurationFromExtensions(TRUE) /*****/typo3/sysext/core/Classes/Core/Bootstrap.php:331
    0.0710    3554344   5. TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtLocalconf(TRUE) /*****/typo3/sysext/core/Classes/Core/Bootstrap.php:680
    0.0711    3554464   6. TYPO3\CMS\Core\Cache\Frontend\PhpFrontend->requireOnce('ext_localconf_c9a96eb557e5c5f6ab301b494c8fc4edfb96a93a') /*****/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php:1418
    0.0711    3554464   7. TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend->requireOnce('ext_localconf_c9a96eb557e5c5f6ab301b494c8fc4edfb96a93a') /*****/typo3/sysext/core/Classes/Cache/Frontend/PhpFrontend.php:82
    0.0712    3555424   8. require_once() /*****/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php:362
    0.0765    4078624   9. TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('rtehtmlarea', ???) /*****/typo3temp/Cache/Code/cache_core/ext_localconf_c9a96eb557e5c5f6ab301b494c8fc4edfb96a93a.php:1568

Actions #2

Updated by Stefan Aebischer about 11 years ago

I can confirm this behavior. I was able to reproduce it with the following steps:

Prerequisites:
  • extdeveval cloned from git -> installed
  • be_scure_pw cloned from git to typo3conf/ext -> not installed
  • t3x vcc downloaded from typo3.org -> not yet uploaded nor installed
  • The extensions don't really matter, just named them here in order to be able to clarify whats going wrong
Steps to reproduce:
  • On page module
  • Clear all caches
    at this point there are no more files in typo3temp/Cache/Code/cache_core/
  • Goto Extension Manager / Manage Extensions
    cache files in typo3temp/Cache/Code/cache_core/ are generated
    extdeveval is present and active in PackageManager_xxx.php -> ok
    be_secure_pw is present and inactive in PackageManager_xxx.php -> ok
  • Upload vcc.t3x in extension manager
    Issue #53217 occurs 'Package "vcc" is not available. Please check if the package exists and that the package key is correct (package keys are case sensitive).'
    Extension is present in typo3conf/ext
    PackageManager_xxx.php is not updated
    vcc is not present and active in PackageManager_xxx.php -> nok
  • Reload Extension Manager / Manage Extensions by clicking on the module in the left pane
    Extension vcc shows up in Extension Manager, but is not installed
    PackageManager_xxx.php is not updated
  • Install vcc by clicking on "Activate" icon
    List reloads extension is installed -> ok
    PackageManager_xxx.php is updated -> ok
    vcc is present in PackageManager_xxx.php -> ok
  • Deinstall vcc by clicking "Deactivate"
    List is reloaded, vcc is not anymore installed -> ok
    PackageManager_xxx.php is updated -> ok
    vcc is present and inactive in PackageManager_xxx.php -> ok
  • Delete vcc from server by clicking "remove" icon
    vcc is removed from list -> ok
    PackageManager_xxx.php is not updated -> nok
    vcc is present as "inactive" in PackageManager_xxx.php -> nok
  • Reload Extension Manager / Manage Extensions by clicking on the module in the left pane
    vcc is not present on list -> ok
    a second PackageManager_xxx.php has been generated (there are two now) -> nok
    In the newer one only core extensions are present. extdeveval and be_secure_pw are not present anymore -> nok
    In the newer one vcc is not present anymore -> ok
    The old PackageManager_xxx.php file has not been cheanged -> nok
  • Reload Extension Manager / Manage Extensions by clicking on the module in the left pane
    PHP Fatal error: Uncaught exception 'BadFunctionCallException' with message 'TYPO3 Fatal Error: Extension key "extdeveval" is NOT loaded! -> nok
  • Remove Cache Files in typo3temp/Cache/Code/cache_core/
  • Reload Extension Manager / Manage Extensions by clicking on the module in the left pane
    extdeveval is not anymore installed -> nok
Actions #3

Updated by Dmitry Dulepov about 11 years ago

What is interesting: all those extensions are 'active' in PackageStates.php in my case. However when the ext_localconf_XXXX.php is loaded from cache, they are not yet marked as active in the package manager. So the activation of extension should go first. When extension's ext_localconf.php is processed, active extension list should be complete already.

Actions #4

Updated by Wouter Wolters almost 11 years ago

  • Status changed from New to Needs Feedback

Current master works just fine for me. Using extension phpunit and tested a couple of others.
Still a problem on current master for you?

Actions #5

Updated by Wouter Wolters over 10 years ago

  • Status changed from Needs Feedback to Closed

No feedback for over 5 months. I will close this now.

Actions #6

Updated by Roman Eberle over 10 years ago

bug still present with TYPO3 6.2.4 and extension 'pagebrowse' 1.3.4

Actions #7

Updated by Michal Cygankiewicz about 10 years ago

Isn't it connected to https://forge.typo3.org/issues/57463 - problem with creating/deleting cache files in typo3temp?

Actions

Also available in: Atom PDF