Skip to content

Commit

Permalink
Merge pull request #468 from albig/95-pr7
Browse files Browse the repository at this point in the history
Bootstrap on accessing the extension configuration in TYPO3 9.
  • Loading branch information
sebastian-meyer committed Feb 10, 2020
2 parents d06eff6 + 75a0e1f commit 197ee7f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Classes/Common/Helper.php
Expand Up @@ -637,6 +637,8 @@ public static function processDBasAdmin(array $data = [], array $cmd = [], $reve
) {
// Instantiate TYPO3 core engine.
$dataHandler = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
// We do not use workspaces and have to bypass restrictions in DataHandler.
$dataHandler->bypassWorkspaceRestrictions = true;
// Load data and command arrays.
$dataHandler->start($data, $cmd);
// Process command map first if default order is reversed.
Expand Down
15 changes: 14 additions & 1 deletion Classes/Hooks/ConfigurationForm.php
Expand Up @@ -14,8 +14,10 @@

use Kitodo\Dlf\Common\Helper;
use Kitodo\Dlf\Common\Solr;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

/**
* Hooks and helper for \TYPO3\CMS\Core\TypoScript\ConfigurationForm
Expand Down Expand Up @@ -93,6 +95,18 @@ public function checkSolrConnection()
*/
public function checkMetadataFormats()
{
// We need to do some bootstrapping manually as of TYPO3 9.
if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version(), '9.0.0', '>=')) {
// Load table configuration array into $GLOBALS['TCA'].
ExtensionManagementUtility::loadBaseTca(false);
// Get extension configuration from dlf/ext_localconf.php.
ExtensionManagementUtility::loadExtLocalconf(false);
// Initialize backend user into $GLOBALS['BE_USER'].
Bootstrap::initializeBackendUser();
// Initialize backend and ensure authenticated access.
Bootstrap::initializeBackendAuthentication();
}

$nsDefined = [
'MODS' => false,
'TEIHDR' => false,
Expand All @@ -101,7 +115,6 @@ public function checkMetadataFormats()
'IIIF2' => false,
'IIIF3' => false
];

$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('tx_dlf_formats');

Expand Down

0 comments on commit 197ee7f

Please sign in to comment.