Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Fix variable type and remove deprecations in FileLocationUpdater #981

Merged
merged 3 commits into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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