IchHabRecht / mask_export

Export your mask elements as extension
GNU General Public License v2.0
45 stars 27 forks source link

using use in ext_tables.php - maybe a hint #176

Closed MatthiasPeltzer closed 3 years ago

MatthiasPeltzer commented 3 years ago

hi there...

i have a templat-extension wich uses "\TYPO3\CMS\Core\Utility\ExtensionManagementUtility" and like intellij recommends, changed this some time ago to: "use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;"

when i tried to install you export extension my typo3 crashes.

i now found out, that if i change my template extension and get rid of "use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;" everything works fine.

maybe it will be also a good idea for your nice extension to prevent this. :)

but this is only a suggestion. thx for your extension and have a nice day.

https://blog.wappler.systems/cannot-use-typo3cmscoreutilityextensionmanagementutility-as-extensionmanagementutility/

IchHabRecht commented 3 years ago

Hi @MatthiasPeltzer,

Thank you for creating the issue. To be honest I don't understand what I can or should do here. I think the export is working as expected. If you add your own changes you have to make sure everything is working afterwards. The export needs to use core classes to register certain behavior. So how can I help you here?

MatthiasPeltzer commented 3 years ago

Hi @IchHabRecht no i don´t need help. My intention was to help you or maybe others. it is no good idea to use a "use" statement in the ext_tables.php file. this is so long fine if no other extension does the same.

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; -> My suggestion: prevent this, this can lead to typo3 errors if it is used multiple... see the link ahead. and this is maybe an often case (e.g. cause of intellij or phpstorm).

IchHabRecht commented 3 years ago

Hi @MatthiasPeltzer,

The export doesn't use "use"-statements in the ext_*.php files.

MatthiasPeltzer commented 3 years ago

https://github.com/IchHabRecht/mask_export/blob/master/ext_tables.php > Line 3: use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

IchHabRecht commented 3 years ago

Thanks for pointing me to this direction. It seems it totally misunderstood the issue!

IchHabRecht commented 3 years ago

Resolved in https://github.com/IchHabRecht/mask_export/commit/3497c6150e237ed66b74ba5a91effec0932136eb

MatthiasPeltzer commented 3 years ago

:)