Commit 4cce5462 authored by Benjamin Franzke's avatar Benjamin Franzke Committed by Benni Mack
Browse files

[TASK] Mark LanguageService container entry as deprecated

Only the container entry – which acts as backend for
GeneralUtility::makeInstance(LanguageService::class) is
deprecated. The class is left as-is, but should be
factored via LanguageServiceFactory.

Therefore also all the factory methods are deprecated
in order for the LanguageServiceFactory to be used instead.

Resolves: #94414
Releases: master
Change-Id: Iab0f713a5baf95c419338748e8df4102d46c37a4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69367

Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 0a1053d2
......@@ -25,10 +25,11 @@ use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Authentication\Mfa\MfaProviderManifestInterface;
use TYPO3\CMS\Core\Authentication\Mfa\MfaRequiredException;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Controller\ErrorPageController;
use TYPO3\CMS\Core\Http\HtmlResponse;
use TYPO3\CMS\Core\Http\RedirectResponse;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Session\UserSessionManager;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -60,6 +61,16 @@ class BackendUserAuthenticator extends \TYPO3\CMS\Core\Middleware\BackendUserAut
'/ajax/core/requirejs',
];
private LanguageServiceFactory $languageServiceFactory;
public function __construct(
Context $context,
LanguageServiceFactory $languageServiceFactory
) {
parent::__construct($context);
$this->languageServiceFactory = $languageServiceFactory;
}
/**
* Calls the bootstrap process to set up $GLOBALS['BE_USER'] AND $GLOBALS['LANG']
*
......@@ -112,7 +123,7 @@ class BackendUserAuthenticator extends \TYPO3\CMS\Core\Middleware\BackendUserAut
if ($this->context->getAspect('backend.user')->isLoggedIn()) {
$GLOBALS['BE_USER']->initializeBackendLogin();
}
$GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
$GLOBALS['LANG'] = $this->languageServiceFactory->createFromUserPreferences($GLOBALS['BE_USER']);
// Re-setting the user and take the workspace from the user object now
$this->setBackendUserAspect($GLOBALS['BE_USER']);
$response = $handler->handle($request);
......@@ -171,7 +182,7 @@ class BackendUserAuthenticator extends \TYPO3\CMS\Core\Middleware\BackendUserAut
): ResponseInterface {
// GLOBALS[LANG] needs to be set up, because the UriBuilder is generating a token, which in turn
// needs the FormProtectionFactory, which then builds a Message Closure with GLOBALS[LANG] (hacky, yes!)
$GLOBALS['LANG'] = LanguageService::createFromUserPreferences($user);
$GLOBALS['LANG'] = $this->languageServiceFactory->createFromUserPreferences($user);
$uri = GeneralUtility::makeInstance(UriBuilder::class)
->buildUriWithRedirectFromRequest(
'auth_mfa',
......
......@@ -32,7 +32,7 @@ use TYPO3\CMS\Core\Core\BootService;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
/**
* Entry point for the TYPO3 Command Line for Commands
......@@ -48,18 +48,22 @@ class CommandApplication implements ApplicationInterface
protected BootService $bootService;
protected LanguageServiceFactory $languageServiceFactory;
protected Application $application;
public function __construct(
Context $context,
CommandRegistry $commandRegistry,
ConfigurationManager $configurationMananger,
BootService $bootService
BootService $bootService,
LanguageServiceFactory $languageServiceFactory
) {
$this->context = $context;
$this->commandRegistry = $commandRegistry;
$this->configurationManager = $configurationMananger;
$this->bootService = $bootService;
$this->languageServiceFactory = $languageServiceFactory;
$this->checkEnvironmentOrDie();
$this->application = new Application('TYPO3 CMS', sprintf(
......@@ -103,7 +107,7 @@ class CommandApplication implements ApplicationInterface
$this->initializeContext();
// create the BE_USER object (not logged in yet)
Bootstrap::initializeBackendUser(CommandLineUserAuthentication::class);
$GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
$GLOBALS['LANG'] = $this->languageServiceFactory->createFromUserPreferences($GLOBALS['BE_USER']);
// Make sure output is not buffered, so command-line output and interaction can take place
ob_clean();
......
......@@ -35,7 +35,7 @@ use TYPO3\CMS\Core\Database\TableConfigurationPostProcessingHookInterface;
use TYPO3\CMS\Core\DependencyInjection\Cache\ContainerBackend;
use TYPO3\CMS\Core\DependencyInjection\ContainerBuilder;
use TYPO3\CMS\Core\IO\PharStreamWrapperInterceptor;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Log\LogManager;
use TYPO3\CMS\Core\Package\FailsafePackageManager;
use TYPO3\CMS\Core\Package\PackageManager;
......@@ -592,6 +592,6 @@ class Bootstrap
public static function initializeLanguageObject()
{
/** @var \TYPO3\CMS\Core\Localization\LanguageService $GLOBALS['LANG'] */
$GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->createFromUserPreferences($GLOBALS['BE_USER']);
}
}
......@@ -18,6 +18,8 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Information;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Contains information and links, or copyright information for the project.
......@@ -42,7 +44,7 @@ class Typo3Information
} elseif (($GLOBALS['LANG'] ?? null) instanceof LanguageService) {
$this->languageService = $GLOBALS['LANG'];
} else {
$this->languageService = LanguageService::create('default');
$this->languageService = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
}
}
......
......@@ -104,8 +104,7 @@ class LanguageService
/**
* Initializes the language to fetch XLF labels for.
* $languageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageService::class);
* $languageService->init($GLOBALS['BE_USER']->user['lang']);
* $languageService = GeneralUtility::makeInstance(LanguageServiceFactory::class)->createFromUserPreferences($GLOBALS['BE_USER']);
*
* @throws \RuntimeException
* @param string $languageKey The language key (two character string from backend users profile)
......@@ -356,22 +355,29 @@ class LanguageService
*
* @param string $locale the locale (= the TYPO3-internal locale given)
* @return static
* @deprecated since TYPO3 v11.3, will be removed in v12.0
*/
public static function create(string $locale): self
{
trigger_error('Method ' . __METHOD__ . ' is deprecated and will be removed in TYPO3 12.0 Use LanguageServiceFactory instead.', E_USER_DEPRECATED);
return GeneralUtility::makeInstance(LanguageServiceFactory::class)->create($locale);
}
/**
* @deprecated since TYPO3 v11.3, will be removed in v12.0
*/
public static function createFromUserPreferences(?AbstractUserAuthentication $user): self
{
if ($user->user['lang'] ?? false) {
return static::create($user->user['lang']);
}
return static::create('default');
trigger_error('Method ' . __METHOD__ . ' is deprecated and will be removed in TYPO3 12.0 Use LanguageServiceFactory instead.', E_USER_DEPRECATED);
return GeneralUtility::makeInstance(LanguageServiceFactory::class)->createFromUserPreferences($user);
}
/**
* @deprecated since TYPO3 v11.3, will be removed in v12.0
*/
public static function createFromSiteLanguage(SiteLanguage $language): self
{
return static::create($language->getTypo3Language());
trigger_error('Method ' . __METHOD__ . ' is deprecated and will be removed in TYPO3 12.0 Use LanguageServiceFactory instead.', E_USER_DEPRECATED);
return GeneralUtility::makeInstance(LanguageServiceFactory::class)->createFromSiteLanguage($language);
}
}
......@@ -17,9 +17,9 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Localization;
/**
* @internal
*/
use TYPO3\CMS\Core\Authentication\AbstractUserAuthentication;
use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
class LanguageServiceFactory
{
/**
......@@ -50,4 +50,17 @@ class LanguageServiceFactory
$obj->init($locale);
return $obj;
}
public function createFromUserPreferences(?AbstractUserAuthentication $user): LanguageService
{
if ($user->user['lang'] ?? false) {
return $this->create($user->user['lang']);
}
return $this->create('default');
}
public function createFromSiteLanguage(SiteLanguage $language): LanguageService
{
return $this->create($language->getTypo3Language());
}
}
......@@ -161,7 +161,8 @@ class ServiceProvider extends AbstractServiceProvider
$container->get(Context\Context::class),
$container->get(Console\CommandRegistry::class),
$container->get(Configuration\ConfigurationManager::class),
$container->get(Core\BootService::class)
$container->get(Core\BootService::class),
$container->get(Localization\LanguageServiceFactory::class)
);
}
......
......@@ -134,13 +134,16 @@ services:
method: 'addCategoryDatabaseSchema'
# @internal
# @todo: deprecate makeInstance(LanguageService::class)
# This service entry is provided for legacy code that instantiates LanguageService
# using GeneralUtility::makeInstance instead of the factory methods which itself
# use LanguageServiceFactory (for install tool compatibility).
TYPO3\CMS\Core\Localization\LanguageService:
shared: false
public: true
deprecated:
package: 'typo3/cms-core'
version: '11.3'
message: 'Injection/Instantiation of "%service_id%" is deprecated. Please use TYPO3\CMS\Core\Localization\LanguageServiceFactory->create().'
TYPO3\CMS\Core\ExpressionLanguage\ProviderConfigurationLoader:
public: true
......
.. include:: ../../Includes.txt
===============================================================
Deprecation: #94414 - Deprecate LanguageService Container Entry
===============================================================
See :issue:`94414`
Description
===========
Instances of :php:`TYPO3\CMS\Core\Localization\LanguageService` require
custom initialization with a language key and additionally depend on core services.
:php:`TYPO3\CMS\Core\Localization\LanguageServiceFactory` has therefore
previously been introduced in order to manage this initialization.
This replaced prior used instantiation via
:php:`TYPO3\CMS\Core\Localization\LanguageService::create()` or
:php:`GeneralUtility::makeInstance(LanguageService::class)`.
Impact
======
Injecting :php:`TYPO3\CMS\Core\Localization\LanguageService` or creating
instances via :php:`GeneralUtility::makeInstance(LanguageService::class)`,
:php:`LanguageService::create()`, :php:`LanguageService::createFromUserPreferences()`
or :php:`LanguageService::createFromSiteLanguage()` will trigger a
PHP :php:`E_USER_DEPRECATED` error.
Affected Installations
======================
Extensions injecting :php:`TYPO3\CMS\Core\Localization\LanguageService`
or creating custom instances via :php:`GeneralUtility::makeInstance(LanguageService::class)`
or :php:`TYPO3\CMS\Core\Localization\LanguageService::create()`.
This is relatively unlikely since most usages are bootstrap related and
extensions usually access the prepared LanguageService via :php:`GLOBALS['LANG']`
in normal cases.
Usages of :php:`LanguageService::create()`, :php:`LanguageService::createFromUserPreferences()`
and :php:`LanguageService::createFromSiteLanguage()` are be found by the extension scanner
as strong match.
Migration
=========
The factory :php:`TYPO3\CMS\Core\Localization\LanguageServiceFactory`
should be injected and used instead.
.. index:: Backend, PHP-API, PartiallyScanned, ext:core
......@@ -27,7 +27,7 @@ use TYPO3\CMS\Core\Crypto\PasswordHashing\Argon2iPasswordHash;
use TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory;
use TYPO3\CMS\Core\Http\PropagateResponseException;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
......@@ -56,7 +56,7 @@ class RecoveryCodesProviderTest extends FunctionalTestCase
parent::setUp();
$this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/be_users.xml');
$this->user = $this->setUpBackendUser(1);
$GLOBALS['LANG'] = LanguageService::createFromUserPreferences($this->user);
$GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->createFromUserPreferences($this->user);
$this->subject = $this->getContainer()->get(MfaProviderRegistry::class)->getProvider('recovery-codes');
}
......
......@@ -25,7 +25,7 @@ use TYPO3\CMS\Core\Authentication\Mfa\MfaViewType;
use TYPO3\CMS\Core\Authentication\Mfa\Provider\Totp;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
......@@ -39,7 +39,7 @@ class TotpProviderTest extends FunctionalTestCase
parent::setUp();
$this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/be_users.xml');
$this->user = $this->setUpBackendUser(1);
$GLOBALS['LANG'] = LanguageService::createFromUserPreferences($this->user);
$GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->createFromUserPreferences($this->user);
$this->subject = $this->getContainer()->get(MfaProviderRegistry::class)->getProvider('totp');
}
......
......@@ -19,7 +19,7 @@ namespace TYPO3\CMS\Core\Tests\Functional\Database;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\QueryGenerator;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
......@@ -32,7 +32,7 @@ class QueryGeneratorTest extends FunctionalTestCase
{
parent::setUp();
$this->setUpBackendUserFromFixture(1);
$GLOBALS['LANG'] = LanguageService::create('default');
$GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->create('default');
}
/**
......
......@@ -18,19 +18,17 @@ declare(strict_types=1);
namespace TYPO3\CMS\Core\Tests\Functional\Localization;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
class LanguageServiceTest extends FunctionalTestCase
{
/**
* @var LanguageService
*/
protected $subject;
protected LanguageService $subject;
protected function setUp(): void
{
parent::setUp();
$this->subject = LanguageService::create('default');
$this->subject = $this->getContainer()->get(LanguageServiceFactory::class)->create('default');
}
/**
......
......@@ -21,7 +21,7 @@ use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Authentication\IpLocker;
use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Session\Backend\SessionBackendInterface;
use TYPO3\CMS\Core\Session\UserSessionManager;
......@@ -323,7 +323,7 @@ class PageRendererTest extends FunctionalTestCase
$GLOBALS['BE_USER']->user = ['uid' => 1];
$GLOBALS['BE_USER']->setLogger(new NullLogger());
$GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
$GLOBALS['LANG'] = $this->getContainer()->get(LanguageServiceFactory::class)->createFromUserPreferences($GLOBALS['BE_USER']);
$GLOBALS['TYPO3_REQUEST'] = (new ServerRequest())
->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE);
......
......@@ -16,7 +16,7 @@
namespace TYPO3\CMS\Core\Tests\Functional\Tca;
use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
......@@ -48,7 +48,7 @@ class BackendGroupsVisibleFieldsTest extends FunctionalTestCase
public function backendGroupsFormContainsExpectedFields()
{
$this->setUpBackendUserFromFixture(1);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
$formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
$formResult = $formEngineTestService->createNewRecordForm('be_groups');
......
......@@ -16,7 +16,7 @@
namespace TYPO3\CMS\Core\Tests\Functional\Tca;
use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
......@@ -64,7 +64,7 @@ class BackendUsersVisibleFieldsTest extends FunctionalTestCase
public function backendUsersFormContainsExpectedFields()
{
$this->setUpBackendUserFromFixture(1);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
$formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
$formResult = $formEngineTestService->createNewRecordForm('be_users');
......@@ -90,7 +90,7 @@ class BackendUsersVisibleFieldsTest extends FunctionalTestCase
public function backendUsersFormContainsExpectedFieldsForAdmins()
{
$this->setUpBackendUserFromFixture(1);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
$formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
$formResult = $formEngineTestService->createNewRecordForm('be_users', ['admin' => true]);
......
......@@ -16,7 +16,7 @@
namespace TYPO3\CMS\Core\Tests\Functional\Tca;
use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
......@@ -39,7 +39,7 @@ class CategoryVisibleFieldsTest extends FunctionalTestCase
public function categoryFormContainsExpectedFields()
{
$this->setUpBackendUserFromFixture(1);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
$formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
$formResult = $formEngineTestService->createNewRecordForm('sys_category');
......
......@@ -16,7 +16,7 @@
namespace TYPO3\CMS\Core\Tests\Functional\Tca;
use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
......@@ -47,7 +47,7 @@ class FileCollectionVisibleFieldsTest extends FunctionalTestCase
public function fileCollectionFormContainsExpectedFields()
{
$this->setUpBackendUserFromFixture(1);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
$formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
......
......@@ -16,7 +16,7 @@
namespace TYPO3\CMS\Core\Tests\Functional\Tca;
use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
......@@ -35,7 +35,7 @@ class FileMetadataVisibleFieldsTest extends FunctionalTestCase
public function fileMetadataFormContainsExpectedFields()
{
$this->setUpBackendUserFromFixture(1);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
$formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
$formResult = $formEngineTestService->createNewRecordForm('sys_file_metadata');
......
......@@ -16,7 +16,7 @@
namespace TYPO3\CMS\Core\Tests\Functional\Tca;
use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
......@@ -41,7 +41,7 @@ class FileStorageVisibleFieldsTest extends FunctionalTestCase
public function fileStorageFormContainsExpectedFields()
{
$this->setUpBackendUserFromFixture(1);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
$formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
$formResult = $formEngineTestService->createNewRecordForm('sys_file_storage');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment