Leuchtfeuer / locate

The users country and preferred language and other facts will be detected. Depending on configurable rules the user can be redirected to other languages or pages. New functionality can be added easily.
https://www.Leuchtfeuer.com
GNU General Public License v2.0
9 stars 14 forks source link

Locate v11 uses Dbal-function fetchOne() not available in TYPO3 10.4.x #39

Closed neufeind closed 2 months ago

neufeind commented 1 year ago

Call to undefined method Doctrine\DBAL\Driver\Mysqli\MysqliStatement::fetchOne() | Error thrown in file /var/www/html/typo3conf/ext/locate/Classes/Hook/OverrideIconOverlayHook.php in line 55

The reason is that MysqliStatement in 10.4.x does not (yet) have a function fetchOne(). But we could use fetch() instead, I guess?

davkraid commented 1 year ago

Thanks for the feedback. What version of doctrine/dbal are you using? Since version 2.11.0, fetchOne is available and fetch is marked as deprecated: https://github.com/doctrine/dbal/blob/2.11.0/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php#L326 TYPO3 10 works with 2.10.x but this version has no fetchOne method. I'will add a requirement in the composer.json for a higher doctrine/dbal version.

davkraid commented 1 year ago

Added requirement here: https://github.com/Leuchtfeuer/locate/commit/b2d7d7804b4004570a95c7bb53ae3160c6721427

neufeind commented 1 year ago

@davkraid Sorry for the late reply. doctrine/dbal is 2.10.4 as shipped with TYPO3 v10.4.36 (non-composer, official download).

neufeind commented 10 months ago

Still an issue with TYPO3 v10 LTS (non-composer). Could we use fetch() instead in EXT:locate? Or drop TYPO v10-support? Unfortunately it's not really possible to clain TYPO3 v10-support but only for composer-mode sigh

Replacing the two fetchOne()-calls worked here.

balasch commented 2 months ago

Unfortunately it is a bit complicated, because we have marked the version V11 for Locate for TYPO3 v10.4 and v11.5 as compatible. We ourselves only work with Composer mode and there are no problems here. You are of course right that TYPO3 without Composer mode comes with a non-matching Doctrine/DBAL version. We now see three possibilities here:

  1. You replace the two fetchOne calls with the previous fetchColumn(0)calls.
  2. You use version v10 instead of v11 of Locate. Or are there features that you are missing in v10?
  3. A correct version is so important to you that you sponsor the work for this implementation.