Skip to content

Commit

Permalink
[BUGFIX] Fix variable type and remove deprecations in FileLocationUpd…
Browse files Browse the repository at this point in the history
…ater (#981)

Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
beatrycze-volk and sebastian-meyer committed Jul 20, 2023
1 parent f78b6b3 commit 2daf3df
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Classes/Updates/FileLocationUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@

namespace Kitodo\Dlf\Updates;

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
use TYPO3\CMS\Install\Updates\ChattyInterface;

use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Symfony\Component\Console\Output\OutputInterface;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\ResourceStorage;
use TYPO3\CMS\Core\Resource\StorageRepository;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
use TYPO3\CMS\Install\Updates\ChattyInterface;

/**
* Migrate reference of thumbnail image in collections record.
Expand All @@ -53,7 +51,7 @@ class FileLocationUpdater implements UpgradeWizardInterface, ChattyInterface, Lo
/**
* Array with table and fields to migrate
*
* @var string
* @var array
*/
protected $fieldsToMigrate = [
'tx_dlf_collections' => 'thumbnail'
Expand Down Expand Up @@ -179,13 +177,13 @@ protected function getRecordsFromTable($countOnly = false)
)
->orderBy('uid')
->execute()
->fetchAll();
->fetchAllAssociative();
if ($countOnly === true) {
$numResults += count($result);
} else {
$allResults[$table] = $result;
}
} catch (DBALException $e) {
} catch (Exception $e) {
throw new \RuntimeException(
'Database query failed. Error was: ' . $e->getPrevious()->getMessage(),
1511950673
Expand Down

0 comments on commit 2daf3df

Please sign in to comment.