terminal42 / contao-inserttags

This is a Contao Open Source CMS extension which allows you to define your own insert tags in the back end.
https://www.terminal42.ch
MIT License
10 stars 7 forks source link

Run module in own namespace for contao 4.4+ #16

Closed fatcrobat closed 7 years ago

fatcrobat commented 7 years ago

Hi there,

i know this module is not actively maintained, but still very helpful within contao 4. If the module is not running in its own namespace within contao 4, i get the following error:

Attempted to call an undefined method named "replaceCachedTags" of class "InsertTags".

Was there any reason why not running in a custom namespace, or old php days?

Can you please merge this pull request?

aschempp commented 7 years ago

Unfortunately, we can't just change the namespace, because that would break the API. Interesting that this even works in Contao 3.5… because the same class exists there as well.

@Toflar aren't you using this extension in your Contao 4 project(s)?

Toflar commented 7 years ago

Yes, no problems so far.

fatcrobat commented 7 years ago

@aschempp This can be closed, registered a hook with $GLOBALS['TL_HOOKS']['replaceInsertTags'] and ran within root namespace as well. Then the contao class loader took my class instead of your Inserttag class. Still strange, but now working for me.