TYPO3 link always resolve to default language - typo3

I recently upgraded from TYPO3 ver. 8.x to ver. 9.x and I am currently running 9.5.20.
We have a setup with 3 languages: DE (default), FR, IT
since the update, no matter what language you are currently on, every typolink leads to the default language.
the typolinks are stored in the database like this:
<a href="t3://page?uid=686">...
some random tidbits that might help narrow the problem down
the 404 page works correctly and is always shown in the right language
the only links that work correctly are the ones used by the blog extension
here are some configurations that might help solve the issue
the config.yaml file
additionalGetParams: ''
base: /
baseVariants:
-
base: 'https://www.example.com/'
condition: 'applicationContext == "Production"'
-
base: 'https://www.example.com/'
condition: 'applicationContext == "Development"'
connectTimeout: 0
debugErrorPageRequestException: false
disableCertificateVerification: false
disableStatisticsRecording: false
errorHandling:
-
errorCode: '404'
errorHandler: Page
errorContentSource: 't3://page?uid=141'
forceLanguage: -1
languages:
-
title: German
enabled: true
base: /de/
typo3Language: de
locale: de_DE.UTF-8
iso-639-1: de
navigationTitle: Deutsch
hreflang: de-DE
direction: ltr
flag: at
languageId: '0'
-
title: English
enabled: true
base: /en/
typo3Language: default
locale: en_CH.UTF-8
iso-639-1: en
navigationTitle: English
hreflang: ''
direction: ''
fallbackType: strict
fallbacks: '1,0,2,3'
flag: en-us-gb
languageId: '1'
-
title: French
enabled: true
base: /fr/
typo3Language: fr
locale: fr_CH.UTF-8
iso-639-1: fr
navigationTitle: French
hreflang: fr-CH
direction: ''
fallbackType: strict
fallbacks: ''
flag: fr
languageId: '2'
-
title: Italian
enabled: true
base: /it/
typo3Language: it
locale: it_CH.UTF-8
iso-639-1: it
navigationTitle: Italiano
hreflang: it-CH
direction: ltr
fallbackType: strict
fallbacks: ''
flag: it
languageId: '3'
passAuthinfoToInsecureConnections: false
passthroughContentTypeHeader: false
requestTimeout: 0
rootPageId: 21
routes: { }
trustInsecureIncomingConnections: false
setup.typoscript
config {
// Language Settings
sys_language_overlay = 0
sys_language_mode = content_fallback
language = de
locale_all = de_CH.UTF-8
htmlTag_setParams = lang="de-CH" dir="ltr" class="no-js"
sys_language_uid = 0
language = de
defaultGetVars {
L = 0
}
[globalVar = GP:L = 1]
config {
sys_language_uid = 1
language = en
locale_all = en_GB.UTF-8
htmlTag_setParams = lang="en" dir="ltr" class="no-js"
}
[global]
[globalVar = GP:L = 2]
config {
sys_language_uid = 2
language = fr
locale_all = fr_FR.UTF-8
htmlTag_setParams = lang="fr-CH" dir="ltr" class="no-js"
}
[global]
[globalVar = GP:L = 3]
config {
sys_language_uid = 3
language = it
locale_all = it_IT.UTF-8
htmlTag_setParams = lang="it-ch" dir="ltr" class="no-js"
}
[global]
any help or hint would be much appreciated.

I think TypoScript conditions like
[globalVar = GP:L = 1]
are not working anymore as of TYPO3 9.
Could you try the new syntax like
[siteLanguage("languageId") == "1"]
https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/SiteHandling/UseSiteInConditions.html#sitehandling-inconditions

Related

Typo3 9.5: Language Fallback does not work with gridelements

I have the following problem:
The language fallbacks do not work for the content of the grid element. The grid element itself (e.g. the headline of it) works as a fallback, but the content is not displayed.
Even if I don't translate the page at all and the complete page content falls back to the fallback (then only menu links and hardcoded translations), the problem occurs.
So far I have been able to find little (almost nothing, to be precise) about the problem and would be pleased if someone could give me a push in the right direction.
YAML-Config:
languages:
-
title: Deutsch
enabled: true
languageId: 0
base: /
typo3Language: de
locale: de_DE.UTF-8
iso-639-1: de
navigationTitle: ''
hreflang: ''
direction: ltr
flag: de
-
title: English
enabled: true
languageId: 1
base: en/
typo3Language: en
locale: en_GB.UTF-8
iso-639-1: en
navigationTitle: English
hreflang: en-EN
direction: ltr
fallbackType: fallback
fallbacks: '0'
flag: gb
-
title: Nederlands
enabled: true
languageId: 2
base: nl/
typo3Language: nl
locale: nl_NL.UTF-8
iso-639-1: nl
navigationTitle: Nederlands
hreflang: nl-NL
direction: ltr
fallbackType: fallback
fallbacks: '1,0'
flag: nl
-
title: Polskie
enabled: true
languageId: 3
base: pl/
typo3Language: pl
locale: pl_PL.UTF-8
iso-639-1: pl
navigationTitle: Polskie
hreflang: pl-PL
direction: ltr
fallbackType: fallback
fallbacks: '1,0'
flag: pl
Config:
config {
colCount = 2
rowCount = 1
rows {
1 {
columns {
1 {
name = Left
colPos = 20
allowed {
CType = shortcut,textmedia,iconlist,link-list-teaser,form_formframework
}
}
2 {
name = Right
colPos = 21
allowed {
CType = shortcut,textmedia,iconlist,link-list-teaser,form_formframework
}
}
}
}
}
}
Setup:
tt_content.gridelements_pi1.20.10.setup {
grid-50-50 < lib.gridelements.defaultGridSetup
grid-50-50 {
cObject = FLUIDTEMPLATE
cObject {
partialRootPaths < lib.contentElement.partialRootPaths
templateRootPaths < lib.contentElement.templateRootPaths
layoutRootPaths < lib.contentElement.layoutRootPaths
file = EXT:XXX/Resources/Private/Content/Gridelements/grid-50-50/Template.html
}
}
}
HTML:
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true">
<f:layout name="Gridelements"/>
<f:section name="Main">
<div class="row">
<div class="columns small-12 tablet-6">{data.tx_gridelements_view_column_20 -> f:format.raw()}</div>
<div class="columns small-12 tablet-6">{data.tx_gridelements_view_column_21 -> f:format.raw()}</div>
</div>
</f:section>
</html>
Could you please check \GridElementsTeam\Gridelements\Plugin\Gridelements::getChildren and make a debug output of $element there?
Usually it should be the UID of the parent container holding the child elements.
Within the method, the child language is determined with $this->languageAspect->getContentId(), so actually the fallback value should be considered correctly.
To check that, make a debug output of getContentId() too.
My current guess is, that either the container ID itself might be wrong or the languageAspect is missing the fallback information.
If they contain the wrong values, please file a bug report at https://gitlab.com/coderscare/gridelements/-/issues

TYPO3 9.5.2 / Typoscript: sys_language_mode = content_fallback not working

I added another language en to my homepage and added it also to the sites with entry point /en/. When I translate the startpage and switching the language to en, then it's working fine. But when I click at another page with no translation for en like /en/contact.html, then I got a 404 PageNotFound Exception. My ts config of the page:
page = PAGE
page {
typeNum = 0
config {
absRefPrefix = /
no_cache = 1
noPageTitle = 1
linkVars = L(0-10)
language = de
locale_all = German
htmlTag_langKey = de-DE
sys_language_uid = 0
sys_language_mode = content_fallback
sys_language_overlay = 1
}
[globalVar = GP:L=1]
page.config {
sys_language_uid = 1
}
[global]
my sites config:
rootPageId: 2
base: 'http://some-domain.de/'
baseVariants: { }
languages:
-
title: 'Meine tolle Webseite'
enabled: true
languageId: '0'
base: /
typo3Language: de
locale: de_DE.UTF-8
iso-639-1: de
navigationTitle: ''
hreflang: ''
direction: ''
flag: de
-
title: 'Andere Sprache'
enabled: true
languageId: '1'
base: /en/
typo3Language: en
locale: en_US.UTF-8
iso-639-1: en
navigationTitle: ''
hreflang: ''
direction: ''
fallbackType: fallback
fallbacks: '0'
flag: en
errorHandling: { }
routes: { }
routeEnhancers:
PageTypeSuffix:
type: PageType
default: .html
map:
.html: 0
A patch was finally merged: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60367
But after release of TYPO3 9.5.5. So expect it to be part of 9.5.6 then.

How to display selected taxonomy of an article in Rest view in drupal 8

How to display selected taxonomy of an article in Rest view in drupal 8
I have created a view with rest export as follows
Format = Serializer
Settings = Fields , Settings
Fields :
Content: Title
Content: Category
Under category i have choosed the below settings:
Filter criteria
Content: Published (= Yes)
Content: Content type (= News)
But when i view the json, the category field, selected taxonomy term is not displaying.
I have created the rest view in Drupal 8 with Article content type for following fields
Title
Tag
Below the export views code change the your project UUID and import it.
uuid: 435345-345ty-4354-35345f-534534fdf
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_tags
- node.type.article
module:
- node
- rest
- serialization
- user
id: test_rest_view
label: 'test rest view'
module: views
description: ''
tag: ''
base_table: node_field_data
base_field: nid
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: perm
options:
perm: 'access content'
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: mini
options:
items_per_page: 10
offset: 0
id: 0
total_pages: null
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous: ‹‹
next: ››
style:
type: serializer
row:
type: fields
options:
inline: { }
separator: ''
hide_empty: false
default_field_elements: true
fields:
title:
id: title
table: node_field_data
field: title
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: false
ellipsis: false
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: false
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: node
entity_field: title
plugin_id: field
field_tags:
id: field_tags
table: node__field_tags
field: field_tags
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: target_id
type: entity_reference_label
settings:
link: false
group_column: target_id
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
plugin_id: field
filters:
status:
value: '1'
table: node_field_data
field: status
plugin_id: boolean
entity_type: node
entity_field: status
id: status
expose:
operator: ''
group: 1
type:
id: type
table: node_field_data
field: type
relationship: none
group_type: group
admin_label: ''
operator: in
value:
article: article
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: node
entity_field: type
plugin_id: bundle
sorts:
created:
id: created
table: node_field_data
field: created
order: DESC
entity_type: node
entity_field: created
plugin_id: date
relationship: none
group_type: group
admin_label: ''
exposed: false
expose:
label: ''
granularity: second
header: { }
footer: { }
empty: { }
relationships: { }
arguments: { }
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- request_format
- url.query_args
- 'user.node_grants:view'
- user.permissions
tags:
- 'config:field.storage.node.field_tags'
rest_export_1:
display_plugin: rest_export
id: rest_export_1
display_title: 'REST export'
position: 1
display_options:
display_extenders: { }
path: testreset
pager:
type: some
options:
items_per_page: 10
offset: 0
style:
type: serializer
options:
formats:
json: json
row:
type: data_field
options:
field_options:
title:
alias: ''
raw_output: false
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- request_format
- 'user.node_grants:view'
- user.permissions
tags:
- 'config:field.storage.node.field_tags'
See rest output

Symfony2 jms/i18n-routing-bundle and security

what I'm trying to do :
locale in url except for default locale
whole pages secured except the login page
i18n-routing-bundle
jms_i18n_routing:
default_locale: %locale%
locales: %locales%
#strategy: prefix
strategy: prefix_except_default
Routes
arsf_base_default:
pattern: /
defaults: { _controller: ArsfBaseBundle:Default:index }
arsf_base_homepage:
pattern: /monit/bysector
defaults: { _controller: ArsfMonitBundle:BySector:index }
arsf_base_login:
pattern: /login
defaults: { _controller: ArsfBaseBundle:Default:login }
arsf_base_login_check:
pattern: /login_check
arsf_base_logout:
pattern: /logout
defaults: { _controller: ArsfBaseBundle:Default:logout }
And I tried to configure security.yml as
login:
pattern: ^/|[a-z]+/login$
security: false
anonymous: true
secured_area:
pattern: ^.*$
form_login:
check_path: arsf_base_login_check
login_path: arsf_base_login
default_target_path: arsf_base_homepage
logout:
path: arsf_base_logout
target: arsf_base_login
access_control:
-
path: ^/|[a-z]+/login$
roles: IS_AUTHENTICATED_ANONYMOUSLY
-
path: ^.*$
roles: ROLE_USER
In this case I get error
Unable to find the controller for path "/login_check"
So I tried to remove login firewall and configure secured_area with anonymous: ~
In this case all pages are accessibles without authentication and I've not found better solution than make a test in my layout :
<html>
<head>...</head>
<body>
{% if app.user %}
...
{% else %}
<script>window.location.replace("{{ path('arsf_base_login') }}");</script>
{% endif %}
</body>
</html>
Is there a better way to do ?
What's wrong in my security conf ?

Highchart / Highstock theme for all charts (here french format)

I spend a lot of time to format each highcharts elements to french format (texts, dates, buttons, etc..)
I propose a little "macro" french theme for your applications using highcharts.
Highcharts.theme = {
lang: {
/*------ Dates translation ------ */
months: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin',
'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
weekdays: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi',
'Jeudi', 'Vendredi', 'Samedi'],
shortMonths: ['Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil',
'Aout', 'Sept', 'Oct', 'Nov', 'Déc'],
/*------ Texts translation ------ */
downloadPNG: 'Télécharger en image PNG',
downloadJPEG: 'Télécharger en image JPEG',
downloadPDF: 'Télécharger en document PDF',
downloadSVG: 'Télécharger en document Vectoriel',
exportButtonTitle: 'Export du graphique',
loading: 'Chargement en cours...',
printButtonTitle: 'Imprimer le graphique',
resetZoom: 'Réinitialiser le zoom',
resetZoomTitle: 'Réinitialiser le zoom au niveau 1:1',
printChart: 'Imprimer le graphique',
/*------ Number Formate ------ */
thousandsSep: ' ', // ex: 52 000
decimalPoint: ',' // ex: 1 525,50
},
credits: {
/*------ Unrelated but usefull to remove credits in each charts ------ */
enabled: false
},
rangeSelector: {
/*------ Highstock date range selector (the 2 little inputs in right corner) ------ */
inputDateFormat: '%e %b %Y', // ex: 8 Avr 2014
inputEditDateFormat: '%d/%m/%Y', // After clicking on item ex : 13/06/2014
// Processing After enter key pressed : apply the 13/06/2014 format
inputDateParser: function (value) {
value = value.split('/');
return Date.UTC(
parseInt(value[2]),
parseInt(value[1]) - 1,
parseInt(value[0])
);
},
/*------ Highstock zoom selector (on the left top side) ------ */
buttons: [{
type: 'month',
count: 1,
text: '1 M' // useless translate :p
}, {
type: 'month',
count: 6,
text: '6 M' // useless translate :p
}, {
type: 'year',
count: 1,
text: '1 A' // translate Y in A (Année in french)
}, {
type: 'all',
count: 1,
text: 'Tout' // translate all in Tout
}],
selected: 2, // Here we force to select 6 M
inputEnabled: true // Active Inputs
},
};
Highcharts.setOptions(Highcharts.theme);
You have to add this file(charts-theme.js) between the highstock.js and your .highcharts function.
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="http://saur/assets/backend/pages/scripts/charts-theme.js"></script>
<script src="http://saur/assets/backend/pages/scripts/charts.js"></script>
Obviously, you can use it with different language, or just to define some "general" uses.
Hope it help.