tx_news does not fallback to right language - typo3-9.x

I have a TYPO3 9.5 website with tx_news. Danish is the default language. I have the languages English, Romanian, Slovakian, Hungarian.
On the Romanian, Slovakian and Hungarian sites I have set the "Fallback to other Language(s) - order is important!" to English, Danish. So fx. Hungarian news should fallback to English news if not translated. But they fallback to Danish news if not translated. All news are in Danish and English.
Why does tx_news not fallback to the selected language?
From config.yaml
base: /
baseVariants: { }
errorHandling:
-
errorCode: '404'
errorHandler: Page
errorContentSource: 't3://page?uid=5'
languages:
-
title: Dansk
enabled: true
languageId: '0'
base: /
typo3Language: da
locale: da_DK
iso-639-1: da
navigationTitle: DK
hreflang: da-DK
direction: ltr
flag: dk
-
title: English
enabled: true
languageId: '2'
base: /en/
typo3Language: default
locale: en_GB.UTF-8
iso-639-1: en
navigationTitle: EN
hreflang: en-GB
direction: ltr
fallbackType: fallback
fallbacks: '0'
flag: gb
-
title: Rumænien
enabled: true
base: /ro/
typo3Language: ro
locale: ro-RO
iso-639-1: ro
navigationTitle: RO
hreflang: ro-RO
direction: ''
fallbackType: fallback
fallbacks: '2,0'
flag: ro
languageId: '3'
-
title: Slovakiet
enabled: true
base: /sk/
typo3Language: sk
locale: sk-SK
iso-639-1: sk
navigationTitle: SK
hreflang: sk-SK
direction: ''
fallbackType: fallback
fallbacks: '2,0'
flag: sk
languageId: '5'
-
title: Hungary
enabled: true
base: /hu/
typo3Language: hu
locale: hu_HU
iso-639-1: hu
navigationTitle: HU
hreflang: hu_HU
direction: ''
fallbackType: fallback
fallbacks: '2,0'
flag: hu
languageId: '6'
rootPageId: 1
routeEnhancers:
NewsPluginDetail:
type: Extbase
limitToPages:
- 105
extension: News
plugin: Pi1
routes:
-
routePath: '/{news_title}'
_controller: 'News::detail'
_arguments:
news_title: news
defaultController: 'News::detail'
aspects:
news_title:
type: PersistedAliasMapper
tableName: tx_news_domain_model_news
routeFieldName: path_segment
NewsPluginList:
type: Extbase
limitToPages:
- 106
extension: News
plugin: Pi1
routes:
-
routePath: '/{page}'
_controller: 'News::list'
_arguments:
page: '#widget_0/currentPage'
defaultController: 'News::list'
defaults:
page: '0'
requirements:
page: \d+
aspects:
page:
type: StaticRangeMapper
start: '1'
end: '100'
routes: { }

Related

Swagger 2.0 Parser error duplicated mapping key

Parser error, duplicated mapping key, Jump to line 52
Issues while adding common parameter id
Line 44 is over-indented. Replace
/tasks/{id}:
get:
with
/tasks/{id}:
get:
There was a lot to fix.
There were multiple parameters defined in one operation.
The path /tasks/{id} was defined multiple times.
=> You have to use once and put each http-method inside this path.
I tried my best to create the YAML and I hope I fixed it correctly.
It's much easier to do such stuff, if the complete code is part of the question.
openapi: 3.0.1
info:
title: Sample API v2
description: Sample Data API v2
contact:
name: John Smith
email: john.smith#email.com
version: v2
servers:
- url: https://task-manager-pvs.herokuapp.com/
paths:
/tasks:
get:
tags:
- Tasks
summary: Get All Tasks
operationId: GetAllTasks
parameters: []
responses:
'200':
description: ''
headers: {}
deprecated: false
security: []
post:
tags:
- Tasks
summary: Create Task
operationId: CreateTask
parameters: []
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/CreateTaskRequest'
example:
name: test
required: true
responses:
'200':
description: ''
headers: {}
deprecated: false
security: []
/tasks/{id}:
get:
tags:
- Single Task
parameters:
- name: id
in: path
required: true
schema:
type: string
description: The Task ID
summary: Get Single Task
operationId: GetSingleTask
responses:
'200':
description: ''
headers: {}
deprecated: false
security: []
patch:
tags:
- Single Task
summary: Update Task
parameters:
- in: path
name: id
schema:
type: string
required: true
description: The Task ID
operationId: UpdateTask
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateTaskRequest'
example:
name: st
required: true
responses:
'200':
description: ''
headers: {}
deprecated: false
security: []
delete:
parameters:
- in: path
name: id
schema:
type: string
required: true
description: The Task ID
tags:
- Single Task
summary: Delete Task
operationId: DeleteTask
responses:
'200':
description: ''
headers: {}
deprecated: false
security: []
components:
schemas:
CreateTaskRequest:
title: CreateTaskRequest
required:
- name
type: object
properties:
name:
type: string
example:
name: test
UpdateTaskRequest:
title: UpdateTaskRequest
required:
- name
type: object
properties:
name:
type: string
example:
name: st
tags:
- name: Tasks
description: ''
- name: Single Task
description: ''

router.currentRoute is showing different route than router.currentRoute.value

I'm trying to get the current route of a component but router.currentRoute is showing some weird behaviour.
router.currentRoute shows the expected route /admin:
RefImpl {__v_isShallow: true, dep: undefined, __v_isRef: true, _rawValue: {…}, _value: {…}}
dep: Set(1) {ReactiveEffect}
__v_isRef: true
__v_isShallow: true
_rawValue: {fullPath: '/admin', path: '/admin', query: {…}, hash: '', name: 'login', …}
_value: {fullPath: '/admin', path: '/admin', query: {…}, hash: '', name: 'login', …}
value: Object
fullPath: "/admin"
hash: ""
href: "/admin"
matched: [{…}]
meta: {}
name: "login"
params: {}
path: "/admin"
query: {}
redirectedFrom: undefined
[[Prototype]]: Object
[[Prototype]]: Object
but router.currentRoute.value shows route /:
{path: '/', name: undefined, params: {…}, query: {…}, hash: '', …}
fullPath: "/"
hash: ""
matched: []
meta: {}
name: undefined
params: {}
path: "/"
query: {}
redirectedFrom: undefined
[[Prototype]]: Object
hence I can't use router.currentRoute.value.path which should show the current route. Is this behaviour expected? How do I get the current route of the component?
Given by the formatting it seems you are using console.log (or similar) API to observe the code effects.
Note that what almost all modern browsers shows in the console is the "lazy" view of the object (when logging objects)
Check this example (which roughly follows the data structures used by Vue Router)
Open example
Open Dev Tools - Console
Click the button twice or more
Only now explore the logged values
Result: Each log of router.currentRoute shows exactly same value (opposed to logs of router.currentRoute.value)
Now try the same thing but unfold the logged object after each click...
TL:DR Do not trust the console! - the value you see is not necessarily the value of the object at the time console.log was executed.
To workaround the issue use console.log(JSON.parse(JSON.stringify(obj))) instead...

Redirect to locale with Nuxtjs and i18n on SPA mode

When I generate Nuxtjs on SPA mode (SSR: false) nuxt generated dist without index.html file.
So I have two problems
1st: I need to redirect to lang folder ex. exmple.com redirect to exmaple.com/{locale}
2nd: I need to redirect for sub-pages ex. exmple.com/admin redirect to exmaple.com/{locale}/admin
// nuxt.config.js
...
i18n: {
lazy: true,
langDir: 'lang/',
locales: [
{
code: 'en',
iso: 'en-US',
file: 'en.js',
name: 'English'
},
{
code: 'ar',
iso: 'ar-EG',
file: 'ar.js',
name: 'عربى'
}
],
defaultLocale: {
locale: 'en',
prefix: true
},
...
I got an idea to solve this problem but I did not know if it is the best solution.
Just using .htaccess to handle requests and return which index I need.

Unrecognized field with Symfony 3.4 and flex

I just started a new Symfony 3.4 project with Flex.
I followed the official documentation of FOSOAuthBundle but when I want to create a token /oauth/v2/token I have this error:" Unrecognized field: randomId "
Here are my configuration files:
#config/packages/fos_oauth_server.yaml
fos_oauth_server:
db_driver: orm
client_class: App\Entity\Client
access_token_class: App\Entity\AccessToken
refresh_token_class: App\Entity\RefreshToken
auth_code_class: App\Entity\AuthCode
service:
user_provider: fos_user.user_provider.username
options:
supported_scopes: user
#config/packages/security.yaml
security:
providers:
user_provider:
id: fos_user.user_provider.username
firewalls:
oauth_token:
pattern: ^/oauth/v2/token
security: false
oauth_authorize:
pattern: ^/oauth/v2/auth
security: false
# Add your favorite authentication process here
main:
pattern: ^/
fos_oauth: true
stateless: true
anonymous: false # can be omitted as its default value
access_control:
- { path: ^/, roles: [ IS_AUTHENTICATED_FULLY ] }
#config/packages/doctrine.yaml
parameters:
env(DATABASE_URL): ''
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '5.7'
charset: utf8mb4
# With Symfony 3.3, remove the `resolve:` prefix
url: '%env(resolve:DATABASE_URL)%'
orm:
auto_generate_proxy_classes: '%kernel.debug%'
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
Do you have an idea?

Validation error with api connect on bluemix: Data does not match any schemas from 'oneOf'

I'm getting the error Data does not match any schemas from 'oneOf' with the following spec:
product: 1.0.0
info:
name: account-information
title: Account Information
version: 1.0.10
termsOfService: >-
These API are a PSD2 implementation example. The service might be
discontinued at any time
visibility:
view:
type: public
subscribe:
type: authenticated
plans:
premium:
title: Premium
apis: {}
rate-limit:
value: 1000/1minute
hard-limit: true
approval: true
default:
title: Default Plan
description: Default Plan
approval: false
rate-limit:
value: 100/hour
hard-limit: true
apis:
account:
$ref: account.yaml
subscription:
$ref: subscription.yaml
The full error message:
Message : "Data does not match any schemas from "oneOf"", Chemin de données : "", Chemin de schéma : "/oneOf"
Message : "Additional properties not allowed", Chemin de données : "/name", Chemin de schéma : "/oneOf/0/additionalProperties"
I don't understand where does the error come from and how to solve it.
For API Connect I believe you want to use x-ibm-name instead of name. I was able to get the following spec validated using your above example:
info:
title: Account Information
x-ibm-name: account-information
version: 1.0.10
visibility:
view:
type: public
subscribe:
type: authenticated
plans:
premium:
title: Premium
apis: {}
rate-limit:
value: 1000/1minute
hard-limit: true
approval: true
default:
title: Default Plan
description: Default Plan
approval: false
rate-limit:
value: 100/hour
hard-limit: true
apis:
account:
$ref: account.yaml
subscription:
$ref: subscription.yaml
Note: I also removed the product field.
You could also use the Design tab to have API Connect create the source automatically in the correct format: