Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_mail
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_mail
Commits
3e08e53a
Commit
3e08e53a
authored
7 years ago
by
Torsten Oppermann
Browse files
Options
Downloads
Patches
Plain Diff
[BUGFIX] Fixing an exception in the be module
parent
e652e07e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
New version 4 1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Classes/Service/BackendService.php
+32
-3
32 additions, 3 deletions
Classes/Service/BackendService.php
Classes/Updates/UpdateLanguages.php
+3
-2
3 additions, 2 deletions
Classes/Updates/UpdateLanguages.php
with
35 additions
and
5 deletions
Classes/Service/BackendService.php
+
32
−
3
View file @
3e08e53a
...
...
@@ -39,7 +39,6 @@ use TYPO3\CMS\Extbase\Mvc\Request;
use
TYPO3\CMS\Extbase\Object\ObjectManager
;
use
TYPO3\CMS\Extbase\Persistence\QueryResultInterface
;
use
TYPO3\CMS\Extbase\Utility\LocalizationUtility
;
use
TYPO3\CMS\Lang\Domain\Repository\LanguageRepository
;
/**
* Backend Service class
...
...
@@ -137,6 +136,34 @@ class BackendService {
return
$siteRoot
[
'uid'
];
}
/**
* Get the selected templates for the selected language
*
* @param string $selectedExtension
* @param string $selectedTemplate
* @param array $languages
* @param int $pid
* @return array
* @throws \InvalidArgumentException
*/
public
static
function
getSelectedTemplates
(
$selectedExtension
,
$selectedTemplate
,
array
$languages
,
$pid
)
{
$selectedTemplates
=
[];
$objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
/** @var TemplateRepository $templateRepository */
$templateRepository
=
$objectManager
->
get
(
TemplateRepository
::
class
);
foreach
(
$languages
as
$language
)
{
$selectedTemplates
[
$language
[
'isocode'
]]
=
$templateRepository
->
findOneByTemplate
(
$selectedExtension
,
$selectedTemplate
,
$language
[
'isocode'
],
$pid
);
}
return
$selectedTemplates
;
}
/**
* get an array of all the locales for the activated languages
*
...
...
@@ -196,8 +223,10 @@ class BackendService {
array_unshift
(
$languages
,
''
);
$filterLanguages
=
[];
foreach
(
$languages
as
$key
=>
$value
)
{
$filterLanguages
[
$value
]
=
$value
;
if
(
count
(
$filterLanguages
)
<
0
)
{
foreach
(
$languages
as
$key
=>
$value
)
{
$filterLanguages
[
$value
]
=
$value
;
}
}
return
$filterLanguages
;
...
...
This diff is collapsed.
Click to expand it.
Classes/Updates/UpdateLanguages.php
+
3
−
2
View file @
3e08e53a
...
...
@@ -72,7 +72,7 @@ class UpdateLanguages extends AbstractUpdate {
$description
=
'Check all the language codes in the database'
;
/** @var DatabaseConnection $databaseConnection */
$databaseConnection
=
$
GLOBALS
[
'TYPO3_DB'
]
;
$databaseConnection
=
$
this
->
getDatabaseConnection
()
;
foreach
(
$this
->
tables
as
$table
)
{
/** @var \mysqli_result $result */
...
...
@@ -94,7 +94,8 @@ class UpdateLanguages extends AbstractUpdate {
* @return bool Whether everything went smoothly or not
*/
public
function
performUpdate
(
array
&
$dbQueries
,
&
$customMessages
)
{
$databaseConnection
=
$GLOBALS
[
'TYPO3_DB'
];
/** @var DatabaseConnection $databaseConnection */
$databaseConnection
=
$this
->
getDatabaseConnection
();
foreach
(
$this
->
tables
as
$table
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment