brotkrueml / typo3-matomo-integration

Matomo integration for TYPO3
https://extensions.typo3.org/extension/matomo_integration
GNU General Public License v2.0
4 stars 4 forks source link

Change site TCA to allow Matomo site IDs to be configured through the environment #8

Closed tehplague closed 2 years ago

tehplague commented 2 years ago

Is your feature request related to a problem? Please describe.

Currently assigning site IDs through the environment is rather difficult. The site configuration YAML itself supports e.g. setting the site id with something like %env(MATOMO_SITE_ID)%. However, as the site IDs TCA field renders a numerical input instead of a text one TYPO3 replaces the environment reference with a 0 when the site configuration is saved later.

Describe the solution you'd like

Could you change the TCA field definition to allow textual input? You may add a validation for either a numerical input or an %env(...)% reference to provide a comparable level of input validation.

Describe alternatives you've considered

In the meantime we keep the %env...%-definition. We have to make sure that nobody accidentally commits the removal of the env-reference in the site YAML. :(

brotkrueml commented 2 years ago

@tehplague You are absolutely right. there is also a plugin available which protects the site id with a hash (which is a string also). If you like, you can provide a PR.

brotkrueml commented 2 years ago

@tehplague Site configuration is adjusted, can you test against main branch if this resolves your issue?

tehplague commented 2 years ago

Yep, works perfectly. Thank you!