evoWeb / store_finder

Store finder extension for TYPO3
GNU General Public License v2.0
2 stars 9 forks source link

LocationRepository::findByUidInBackend() must be of the type int, string given #23

Closed vmandal closed 4 years ago

vmandal commented 4 years ago

Error while creating Store Location record in BE Typo3 versions: typo3 9.5.16@dev, typo3 9.5.14 PHP Version 7.3.16

Oops, an error occurred!
Argument 1 passed to EvowebStoreFinderDomainRepositoryLocationRepository::findByUidInBackend() must be of the type int, string given, called in /typo3conf/ext/store_finder/Classes/Hook/TceMainHook.php on line 6
wechselstroom commented 4 years ago

This error happens when mysql strict mode is enabled. A quick fix is to add the following line to $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']

'initCommands' => 'SET SESSION sql_mode = \'NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\';'

wechselstroom commented 4 years ago

Another possible fix, if you don't want to disable strict mode is to override the TCA:

$GLOBALS['TCA']['tx_storefinder_domain_model_location']['columns']['latitude']['config']['default'] = 0; $GLOBALS['TCA']['tx_storefinder_domain_model_location']['columns']['longitude']['config']['default'] = 0;