I am writing TYPO3 extension and inside main method of extension I need to get absolute path of extension so I have this piece of code:
...
$extPth = t3lib_extMgm::extPath($_EXTKEY);
$tempUploadPth = $extPth.'/res/uploads';
return $tempUploadPth;
...
However, when I run the page, TYPO3 returns this error message:
"TYPO3 Fatal Error: Extension key "" was NOT loaded!"
In the EM I have configured extension key, and here are the properties from
localconf.php
It is notable two lines refering to same property are duplicate - and I don't know how did that happen. I didn't enter them manually.
$TYPO3_CONF_VARS['EXT']['extList'] = 'info,perm,func,filelist,about,tsconfig_help,context_help,extra_page_cm_options,impexp,sys_note,tstemplate,tstemplate_ceditor,tstemplate_info,tstemplate_objbrowser,tstemplate_analyzer,func_wizards,wizard_crpages,wizard_sortpages,lowlevel,install,belog,beuser,aboutmodules,setup,taskcenter,info_pagetsconfig,viewpage,rtehtmlarea,css_styled_content,t3skin,t3editor,reports,felogin,form,introduction';
$TYPO3_CONF_VARS['EXT']['extList'] = 'extbase,css_styled_content,info,perm,func,filelist,about,tsconfig_help,extra_page_cm_options,impexp,sys_note,tstemplate,tstemplate_ceditor,tstemplate_info,tstemplate_objbrowser,tstemplate_analyzer,func_wizards,wizard_crpages,wizard_sortpages,lowlevel,install,belog,beuser,aboutmodules,setup,taskcenter,info_pagetsconfig,viewpage,rtehtmlarea,t3skin,t3editor,reports,felogin,form,introduction,rsaauth,saltedpasswords,fluid,version,workspaces,scheduler,linkvalidator,automaketemplate,realurl,tt_news,indexed_search,wt_spamshield,jquerycolorbox,kickstarter,player_profile,sponzorstvo_amer'; // Modified or inserted by TYPO3 Extension Manager. Modified or inserted by TYPO3 Core Update Manager.
$TYPO3_CONF_VARS['EXT']['extList_FE'] = 'extbase,css_styled_content,install,rtehtmlarea,t3skin,felogin,form,introduction,rsaauth,saltedpasswords,fluid,version,workspaces,automaketemplate,realurl,tt_news,indexed_search,wt_spamshield,jquerycolorbox,kickstarter,player_profile,sponzorstvo_amer'; // Modified or inserted by TYPO3 Extension Manager.
As you can see last two lines have key "sponzorstvo_amer" entered, and I still don't know why I get this error when using global variable $_EXTKEY
Any thoughts??
Probably, $_EXTKEY
is not defined ?
If we will check classical tt_news extension, in the begining we could see the manual definition of the extension key :
...
var $extKey = 'tt_news'; // The extension key.
...
So, it's seems what in the plugin context the $_EXTKEY
should not be used, as it's possible in ext_tables.php
, for example.