TYPO3 9.5: Plugin RouteEnhancers Nested Arguments - typo3

I use the extension tx_sfeventmgt_pievent in my TYPO3, but this generates ugly URLs like:
?tx_sfeventmgt_pievent[overwriteDemand][month]=1&tx_sfeventmgt_pievent[overwriteDemand][year]=2020&cHash=q76r9wfs0gv
I try to route this to something nicer like:
/2020/1(or later january)/
but the nested arguments don't get evaluated. My config.yaml looks like:
routeEnhancers:
KalenderPlugin:
type: Plugin
limitToPages: [45]
namespace: 'tx_sfeventmgt_pievent'
routePath: '/{year}/{month}/{hash}'
_arguments:
overwriteDemand/month: '[0-9]{1..2}'
overwriteDemand/year: '[0-9]{4}'
The pageid 45 must open without arguments (the extension uses the current date), but when I call /2020/1/, I want it as the GET parameter so the extension shows the other month of the year.
How does the config.yaml have to look like?

Give it a try with this config.yaml where the defaults might not be necessary but I added them for showing a complete configuration.
routeEnhancers:
KalenderPlugin:
type: Plugin
limitToPages: [45]
namespace: 'tx_sfeventmgt_pievent'
routePath: '/{overwriteDemand/year}/{overwriteDemand/month}/{hash}'
requirements:
overwriteDemand/year: '[0-9]{4}'
overwriteDemand/month: '[0-9]{1..2}'
defaults:
overwriteDemand/year: '2020'
overwriteDemand/month: '10'
hash: ''

Related

Conditional expression in withParam of argo workflow template spec

Is it possible to specify a conditional expression in the withParam of a template step? For example, I have a very typical parallelization case that works fine:
#...
templates:
- name: my-template
steps:
- - name: make-list
template: makes-a-list
- - name: consume-list
template: process-list-element
arguments:
parameters:
- name: param-name
value: "{{item}}"
withParam: "{{steps.make-list.outputs.result}}"
What I'd like to do is be able to have consume-list use a different list of "items" to process in parallel, if specified. I've tried several variations of this:
withParam: "{{= workflow.parameters.use-this-list == '' ? steps.make-list.outputs.result : workflow.parameters.use-this-list }}"
where workflow-level parameter use-this-list can be given as a JSON list (e.g., '["item1","item2"]') or an empty string, in which case I'd like the template to use the output of the make-list step.
I've tried that conditional expression many different ways -- using different quotations, using toJson around different parts of it, etc. -- but argo never seems to be able to understand it.
Is it possible to do something like this? FWIW I haven't found any examples anywhere that attempt this sort of thing.

Github Pages cannot find index.html only in some directories

Update: I got fed up and re-do everything from the ground-up and it fixes itself.
I have a github pages site built with Jekyll and Chirpy theme.
Locally, it runs great.
However when deployed on Github Pages there are a few directories that return the 404 page even though the path is valid and there is an index.html file in it.
Example:
https://catmandx.github.io/posts/Wgel-CTF-Writeup/ display normally
https://catmandx.github.io/tags/cmc/index.html returns 404
http://127.0.0.1:4000/tags/cmc/index.html display correcly.
I have temporarily make the repo public, it's here: https://github.com/catmandx/catmandx.github.io
I have been banging my head for a few hours now. I have tried committing and pushing again to re-run Actions, manually editing the /tags/cmc/index.html file in the gh-pages branch but nothing works.
This is the _config.yml file, not sure if it helps but here:
# The Site Settings
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT licensed
# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
# --------------------------
title: Hoang Nguyen # the main title
tagline: Simple Blog. # it will display as the sub-title
description: >- # used by seo meta and the atom feed
A minimal, portfolio, sidebar,
bootstrap Jekyll theme with responsive web design
and focuses on text presentation.
# fill in the base hostname & protocol for your site, e.g., 'https://username.github.io'
url: 'https://catmandx.github.io'
author: Hoang Nguyen # change to your full name
avatar: /assets/img/avatar.jpg # support internet resources
github:
username: catmandx # change to your github username
#twitter:
# username: twitter_username # change to your twitter username
social:
name: Hoang Nguyen # it will shows as the copyright owner in Footer
email: hhoang.nov.13#gmail.com # change to your email address
links:
# The first element serves as the copyright owner's link
# - https://twitter.com/username # change to your twitter homepage
- https://github.com/catmandx # change to your github homepage
# Uncomment below to add more social links
- https://www.facebook.com/whohoi
# - https://www.linkedin.com/in/username
# google_site_verification: google_meta_tag_verification # change to your verification string
# --------------------------
# Only if your site type is GitHub Project sites and doesn't have a custom domain,
# change below value to '/projectname'.
baseurl: ''
# Change to your timezone › http://www.timezoneconverter.com/cgi-bin/findzone/findzone
timezone: Asia/Ho_Chi_Minh
google_analytics:
id: '' # Fill with your Google Analytics ID
pv:
# The Google Analytics pageviews switch.
# DO NOT enable it unless you know how to deploy the Google Analytics superProxy.
enabled: false
# the next options only valid when `google_analytics.pv` is enabled.
proxy_url: ''
proxy_endpoint: ''
cache: false # pv data local cache, good for the users from GFW area.
disqus:
comments: false # boolean type, the global switch for posts comments.
shortname: '' # Fill with your Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
# Prefer color scheme setting.
#
# Note: Keep empty will follow the system prefer color by default,
# and there will be a toggle to switch the theme between dark and light
# on the bottom left of the sidebar.
#
# Available options:
#
# light - Use the light color scheme
#
# dark - Use the dark color scheme
#
theme_mode: # <light|dark>
# boolean type, the global switch for ToC in posts.
toc: true
paginate: 10
kramdown:
syntax_highlighter: rouge
syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options
css_class: highlight
# default_lang: console
span:
line_numbers: false
block:
line_numbers: true
start_line: 1
# DO NOT change this unless you're a Pro user on Jekyll and Web development,
# or you think you're smart enough to change other relevant URLs within this template.
permalink: /posts/:title/
collections:
tabs:
output: true
sort_by: order
defaults:
-
scope:
path: '' # An empty string here means all files in the project
type: posts
values:
layout: post
comments: true # Enable comments in posts.
toc: true # Display TOC column in posts.
breadcrumb:
-
label: Posts
url: /
-
scope:
path: _drafts
values:
comments: false
-
scope:
path: index.html
values:
breadcrumb:
-
label: Posts
-
scope:
path: tags
values:
breadcrumb:
-
label: Home
url: /
-
label: Tags
url: /tabs/tags/
-
scope:
path: categories
values:
breadcrumb:
-
label: Home
url: /
-
label: Categories
url: /tabs/categories/
-
scope:
path: ''
type: tabs # see `site.collections`
values:
layout: page
dynamic_title: true # Hide title in mobile screens.
breadcrumb:
-
label: Home
url: /
sass:
sass_dir: /assets/css
style: compressed
compress_html:
clippings: all
comments: all
endings: all
profile: false
blanklines: false
ignore:
envs: []
exclude:
- vendor
- Gemfile.lock
- Gemfile
- tools
- docs
- README.md
- LICENSE
- example
jekyll-archives:
enabled: [categories, tags]
layouts:
category: category
tag: tag
permalinks:
tag: /tags/:name/
category: /categories/:name/
Update: This is the log, as you can see, the files exists but all the subdirectories in /categories and /tags returns 404:
You can solve this issue by executing bash tools/init.sh
You will also have to run this init.sh every time there is a category/tag created.

TYPO3 cms-indexed-search core extension missing RouteEnhancer?

we are updating an ancient TYPO3 project, we already run on TYPO3 9.5 and its looking good after alot of refactoring.
now i rework the ext:indexed_search section which got implemented into the T3Core (sysext:indexed_search). so if i disable/remove my site configuration, the search just works out of the box. once i enable our default site configuration, holding:
base: 'ourDomain'
baseVariants:
-
base: 'ourDomain'
condition: 'applicationContext == "Development"'
-
base: 'ourDomain'
condition: 'applicationContext == "Testing"'
errorHandling: { }
languages:
-
title: Deutsch
enabled: true
base: /
typo3Language: de
locale: de_DE
iso-639-1: de
navigationTitle: Deutsch
hreflang: de-DE
direction: ''
flag: at
languageId: '0'
rootPageId: 1
routes: { }
routeEnhancers:
the search does not work properly anymore. i can navigate to the search page and still have the search form and stuff but no results are shown. im dumping $search inside SearchController and saw that its actually empty no matter what.
after some research i thought the RouteEnhancer configuration could be the problem, so i added some configuration to the site cfg
routeEnhancers:
IndexedSearchPlugin:
type: Extbase
limitToPages:
- 41
extension: IndexedSearch
plugin: Pi2
routes:
- routePath: '/search'
_controller: 'Search::search'
defaultController: 'Search::search'
so as child of our root-page we have a page called "Suche"(route=/suche) which holds the indexed_search plugin.
so the RouteEnhancer should work like domain.at/suche -> hit search -> /suche/search results, right? it seems like everything works but the data from the search input field is just missing... so there are no results.
i cannot get this to work since quite some time now, help is much appreciated
a missing trailing slash in the form action was the problem. because without that slash a user would get redirected while loosing POST data.
solution:
.htaccess:
#redirect urls without slash
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
site configuration:
routeEnhancers:
IndexedSearchPlugin:
type: Extbase
limitToPages:
- 41
extension: IndexedSearch
plugin: Pi2
routes:
- routePath: '/search'
_controller: 'Search::search'
defaultController: 'Search::search'
PageTypeSuffix:
type: PageType
default: '/'
index: ''
map:
'/': 0

Cascading eslint config file

I have few questions about cascading eslint config file:
Can I use eslint like a tsconfig.json (in typescript) where I have a root .eslintrc.yml and I can extend/cascade that to each .eslintrc.yml for each folder (project)? I'm not sure if this is what the documentation says here.
If I can extend a root config file how does it work on the case of extends option where sometimes the order is important like on the case of eslint-config-prettier as mentioned on their docs. There it says:
Make sure to put it last, so it gets the chance to override other configs.
Correct me if my understanding is correct that with plugins option the order is not important but on extends sometimes the order is important like what I mentioned on question #2.
If the order is important on extends option, how can I make sure that it follows the order when I have an extension like eslint-plugin-prettier where it should be the last when I'm not using cascading. For example:
If I'm not using cascading it should be like this as what is mentioned here:
extends:
- "some-other-config-you-use"
- "prettier"
- "prettier/#typescript-eslint"
- "prettier/react"
If I'm using cascading my setup will be like this:
# root
root: true
parser: "#typescript-eslint/parser"
extends:
- "eslint:recommended"
- "plugin:#typescript-eslint/recommended"
- "prettier"
- "prettier/#typescript-eslint"
# sub-folder
env:
browser: true
extends:
- "plugins:react/recommended"
- "plugins:jsx-a11y/recommended"
- "prettier/react"
root: true
parser: "#typescript-eslint/parser"
extends:
- "eslint:recommended"
- "plugin:#typescript-eslint/recommended"
- “./path/your_other_config”
- "prettier"
- "prettier/#typescript-eslint"
Related to this, I was running into an error after creating the .eslintrc.js file in a subdirectory:
Parsing error: "parserOptions.project" has been set for #typescript-eslint/parser.
The file does not match your project config
The solution was to specify ignorePatterns: ['.eslintrc.js'], in the root config, as discussed here.

Could not locate path for parameter 'petId' warning in eclipse KaiZen Open API Editor

Eclipse Oxygen 3a with KaiZen-OpenAPI-Editor (0.8.0.201905261858) shows warning when path parameter is specified in components -> parameters.
No such warning is displayed for query parameter.
openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger for pet module
paths:
/Pets/{petId}:
get:
operationId: getPet
parameters:
- $ref: "#/components/parameters/petId"
responses:
200:
description: pet response
components:
parameters:
petId:
name: petId
in: path
required: true
schema:
type: string
Following warning is displayed on line specifying name: petId:
Could not locate path for parameter 'petId'
Indeed, this is an issue with KaiZen-OpenAPI-Parser, one of the related projects. I have submitted a pull request here to fix the issue.
In the meantime, you can ignore the warning, or disable the Advanced Validation option in Preferences > KaiZen > OpenAPI v3 > Validation.