#86895routeEnhancer not working correct for paginate widget
Description
routeEnhancers:
CommunityPlugin:
type: Extbase
limitToPages: [15]
extension: Blacommunity
plugin: Blaforum
routes:
- routePath: ''
_controller: 'Subforum::list'
- routePath: '/{subforum_title}'
_controller: 'Subforum::show'
_arguments:
'subforum_title': 'subforum'
- routePath: '/{subforum_title}/{topic_title}/{page}'
_controller: 'Topic::show'
_arguments:
'subforum_title': 'subforum'
'topic_title': 'topic'
'page': '@widget_0/currentPage'
defaultController: 'Subforum::show'
defaults:
page: '0'
requirements:
page: '\d+'
aspects:
subforum_title:
type: PersistedAliasMapper
tableName: 'tx_blacommunity_domain_model_subforum'
routeFieldName: 'slug'
topic_title:
type: PersistedAliasMapper
tableName: 'tx_blacommunity_domain_model_topic'
routeFieldName: 'slug'
page:
type: StaticRangeMapper
start: '1'
end: '1000'
Setting the defaults page on ‘1’ or ‘0’ has no effect, for pages 2 and further the routing works fine. On the first page ‘@widget_0/currentPage’ cannot be found as an argument. I expected it the work as https://symfony.com/doc/current/routing/optional_placeholders.html: “By adding page to the defaults key, the {page} placeholder is no longer required. “ so e.g.
URL Route Parameters
/blog blog {page} = 1
/blog/1 blog {page} = 1
/blog/2 blog {page} = 2
TYPO3 9.5.1.
Reviews 5
- main 63529[BUGFIX] Allow slashes in enhanced routes having aspects definitions
- 9.5 63655[BUGFIX] Allow slashes in enhanced routes having aspects definitions
- 9.5 60361[BUGFIX] Ensure route defaults and requirements are considered
- main 62885[BUGFIX] Ensure route defaults and requirements are considered
- 9.5 63011[WIP][TASK] Testing current behavior on enhancer defaults & requirements
Related issues 7
- Bug #87436Routing: empty 'defaults' entry does not work
- Bug #87731ExtbasePluginEnhancer requirements ignored
- Task #88686Fix requirements in parameter
- Bug #89185Routing: requirements are not validated for PersistedAliasMapper in PluginEnhancer/ExtbasePluginEnhancer
- Bug #89641Routing configuration with 3rd party url segments
- Bug #90149Consider Symfony route modifier
- Bug #90531Requirements are not considered when an aspect is present
History 2952
Show 1327 earlier messages
-
Jacco van der Post commented <span data-processor="relativetime" data-value="2018-11-09T14:47:53+00:00" > 11/09/18, 14:47 </span>
-
Jacco van der Post changed subject
routeEnhancer not working for page 1 of paginate widgetrouteEnhancer not working correct for paginate widget <span data-processor="relativetime" data-value="2018-11-09T14:48:47+00:00" > 11/09/18, 14:48 </span> -
Jacco van der Post commented <span data-processor="relativetime" data-value="2018-11-10T13:03:28+00:00" > 11/10/18, 13:03 </span>
Further investigation. So I have a list of topics with links like (decoded here) :
[1.] https://mysite.test/community
?tx_blacommunity_blaforum[action]=show
&tx_blacommunity_blaforum[controller]=Topic
&tx_blacommunity_blaforum[subforum]=1
&tx_blacommunity_blaforum[topic]=90
&cHash=8f508425fc790714af77ae33d800673eThis should change the HTML link into https://mysite.test/community/subforumtitle/topictitle
It does not, when {page} is included in the routepath.When on that page [1.], the pagebrowser shows the correct links for pages 2 and further. Clicking on for example [2.] https://mysite.test/community/subforumtitle/topictitle/2 works. However on that page [2.] the links are not correct; page 1 links back to https://mysite.test/community and the other pages show the URL with parameters as above.
When entered by hand in the browser the links do work:
https://mysite.test/community/subforumtitle/topictitle/2
https://mysite.test/community/subforumtitle/topictitle/3
etc.But https://mysite.test/community/subforumtitle/topictitle or https://mysite.test/community/subforumtitle/topictitle/1 does not work..
Since there is no RealUrl available anymore, I hope I find a solution soon… or I might end up replacing the fluid widget by coding my own pagebrowser. Thx
-
Vasyl Mosiychuk commented <span data-processor="relativetime" data-value="2018-11-11T17:11:54+00:00" > 11/11/18, 17:11 </span>
I have the same problem with the pagination widget…
-
Carsten Pohl commented <span data-processor="relativetime" data-value="2018-11-12T10:32:02+00:00" > 11/12/18, 10:32 </span>
Vasyl Mosiychuk wrote:
> I have the same problem with the pagination widget…
Same behaviour here, the pagination widget looses all the arguments which are not the widget arguments. -
Carsten Pohl commented <span data-processor="relativetime" data-value="2018-11-15T15:37:40+00:00" > 11/15/18, 15:37 </span>
Carsten Pohl wrote:
> Vasyl Mosiychuk wrote:
> > I have the same problem with the pagination widget…
> Same behaviour here, the pagination widget looses all the arguments which are not the widget arguments.The widget needs the addquerystringmethod, then the widget keeps the variables.
<f:widget configuration="{addQueryString:1, addQueryStringMethod: 'GET'"></f:widget>With this configuration for the routeEnhancers i get the right pagination.
- routePath: '/{category_var}' _controller: 'News::list' _arguments: category_var: cat - routePath: '/{category_var}/{page}' _controller: 'News::list' _arguments: category_var: cat page: '@widget_0/currentPage' -
Jacco van der Post commented <span data-processor="relativetime" data-value="2018-11-15T20:25:41+00:00" > 11/15/18, 20:25 </span>
@Carsten, thx good find.
However there is still a problem when using ‘defaults’, I would expect that if it’s filled in, that the argument is not necessary.
I have this problem with another parameter (not from this Fluid pagination widget).For example both URL’s should work:
/blog blog {page} = 1
/blog/1 blog {page} = 1Since I use now another solution then the Fluid pagination widget, could you test if this works for you?
-
Wolfgang Klinger changed Related to #87436 <span data-processor="relativetime" data-value="2019-01-15T06:37:44+00:00" > 01/15/19, 06:37 </span>
-
Benjamin Robinson commented <span data-processor="relativetime" data-value="2019-02-06T15:46:47+00:00" > 02/06/19, 15:46 </span>
The paginator link issue (page 2 to page 1) can also be solved by outsourcing the list view to an additional routeEnhancer of type “Plugin”:
routeEnhancers: NewsDetail: type: Extbase extension: News plugin: Pi1 routes: - { routePath: '/{news_title}', _controller: 'News::detail', _arguments: {'news_title': 'news'} } aspects: news_title: type: PersistedAliasMapper tableName: 'tx_news_domain_model_news' routeFieldName: 'path_segment' NewsList: type: Plugin routePath: '/{@widget_0/currentPage}' namespace: 'tx_news_pi1' aspects: '@widget_0/currentPage': type: StaticRangeMapper start: '1' end: '1000'At least that worked successfully for the news extension.
-
Gerrit Code Review pushed patch set 2 for 9.5 to change 60361 status
NewUnder Review <span data-processor="relativetime" data-value="2019-04-02T15:00:01+00:00" > 04/02/19, 15:00 </span> -
Christian Hackl commented <span data-processor="relativetime" data-value="2019-11-22T17:09:23+00:00" > 11/22/19, 17:09 </span>
This patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/60361 doesn’t work for me.
I have set type: Extbase – defaults: page: ‘1’ – but if I go back from page 2 – the URL shows me the extension parameters (for example: domain.tld/list?tx_myext_plugin%5Baction%5D=list&tx_myext_plugin%5Bcontroller%5D=Controller&cHash=86ec23d78c357b460a441a2e2a720d0f
instead of “domain.tld/list/page-1” or “domain.tld/list”… -
Pascal Geldmacher commented <span data-processor="relativetime" data-value="2019-12-13T08:36:51+00:00" > 12/13/19, 08:36 </span>
I’ve the same problem with the pagination widget. On our website we use the blog extension, which have the same problem if you go from page 2 to page 1
https:/my-page.test/blog/?tx_blog_posts%5Baction%5D=listRecentPosts&tx_blog_posts%5Bcontroller%5D=Post&cHash=cdbbbaf5a61a58771bfabda89c663f8b
and we also have the same error with our custom extension. -
Gerrit Code Review pushed patch set 3 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2019-12-27T22:13:00+00:00" > 12/27/19, 22:13 </span>
-
Susanne Moog changed Sprint Focus On Location Sprint <span data-processor="relativetime" data-value="2020-01-12T12:48:07+00:00" > 01/12/20, 12:48 </span>
-
Gerrit Code Review pushed patch set 1 for master to change 62885 <span data-processor="relativetime" data-value="2020-01-14T22:30:10+00:00" > 01/14/20, 22:30 </span>
-
Gerrit Code Review pushed patch set 2 for master to change 62885 <span data-processor="relativetime" data-value="2020-01-14T22:48:16+00:00" > 01/14/20, 22:48 </span>
-
Gerrit Code Review pushed patch set 4 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-15T23:44:46+00:00" > 01/15/20, 23:44 </span>
-
Gerrit Code Review pushed patch set 5 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-15T23:45:57+00:00" > 01/15/20, 23:45 </span>
-
Gerrit Code Review pushed patch set 6 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-15T23:48:10+00:00" > 01/15/20, 23:48 </span>
-
Gerrit Code Review pushed patch set 7 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-16T17:02:58+00:00" > 01/16/20, 17:02 </span>
-
Gerrit Code Review pushed patch set 8 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-19T15:23:40+00:00" > 01/19/20, 15:23 </span>
-
Oliver Hader changed Related to #90149 <span data-processor="relativetime" data-value="2020-01-20T08:54:48+00:00" > 01/20/20, 08:54 </span>
-
Gerrit Code Review pushed patch set 9 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-20T17:00:13+00:00" > 01/20/20, 17:00 </span>
-
Gerrit Code Review pushed patch set 10 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-20T20:32:20+00:00" > 01/20/20, 20:32 </span>
-
Gerrit Code Review pushed patch set 11 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-20T20:57:25+00:00" > 01/20/20, 20:57 </span>
-
Gerrit Code Review pushed patch set 12 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-20T22:11:37+00:00" > 01/20/20, 22:11 </span>
-
Gerrit Code Review pushed patch set 13 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-20T23:16:42+00:00" > 01/20/20, 23:16 </span>
-
Gerrit Code Review pushed patch set 14 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-22T15:03:39+00:00" > 01/22/20, 15:03 </span>
-
Gerrit Code Review pushed patch set 15 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-22T15:57:18+00:00" > 01/22/20, 15:57 </span>
-
Gerrit Code Review pushed patch set 3 for master to change 62885 <span data-processor="relativetime" data-value="2020-01-22T16:03:34+00:00" > 01/22/20, 16:03 </span>
-
Gerrit Code Review pushed patch set 16 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-22T16:06:08+00:00" > 01/22/20, 16:06 </span>
-
Gerrit Code Review pushed patch set 4 for master to change 62885 <span data-processor="relativetime" data-value="2020-01-22T16:08:33+00:00" > 01/22/20, 16:08 </span>
-
Gerrit Code Review pushed patch set 5 for master to change 62885 <span data-processor="relativetime" data-value="2020-01-22T18:24:31+00:00" > 01/22/20, 18:24 </span>
-
Gerrit Code Review pushed patch set 6 for master to change 62885 <span data-processor="relativetime" data-value="2020-01-22T18:35:00+00:00" > 01/22/20, 18:35 </span>
-
Gerrit Code Review pushed patch set 7 for master to change 62885 <span data-processor="relativetime" data-value="2020-01-22T18:35:52+00:00" > 01/22/20, 18:35 </span>
-
Oliver Hader changed Related to #87731 <span data-processor="relativetime" data-value="2020-01-23T11:46:48+00:00" > 01/23/20, 11:46 </span>
-
Oliver Hader changed Related to #88686 <span data-processor="relativetime" data-value="2020-01-23T11:51:07+00:00" > 01/23/20, 11:51 </span>
-
Gerrit Code Review pushed patch set 17 for 9.5 to change 60361 <span data-processor="relativetime" data-value="2020-01-28T10:50:53+00:00" > 01/28/20, 10:50 </span>
-
Oliver Hader commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2020-01-28T11:00:05+00:00" > 01/28/20, 11:00 </span>Applied in changeset commit:35d96a8418ce5ba74890b1a9a457d6f00ea571db.
-
Oliver Hader changed Related to #89641 <span data-processor="relativetime" data-value="2020-01-28T11:50:31+00:00" > 01/28/20, 11:50 </span>
-
Felix Nagel commented <span data-processor="relativetime" data-value="2020-02-20T11:07:04+00:00" > 02/20/20, 11:07 </span>
Can somebody help me how to configure the pagination in order to have same URL for /list/ and /list/page/1 when on list page or page 1? I assumed this ticket would solve my “duplicate content / same page but different URL” problem but in TYPO3 9.l5.14 its still present. Any ideas?
-
Benjamin Robinson commented <span data-processor="relativetime" data-value="2020-02-20T11:10:54+00:00" > 02/20/20, 11:10 </span>
Felix Nagel wrote:
> Can somebody help me how to configure the pagination in order to have same URL for /list/ and /list/page/1? I assumed this ticket would solve my “duplicate content / same page but different URL” problem but in TYPO3 9.l5.14 its still present. Any ideas?Does my above example not work for you to solve duplicate content for page 1?
-
Felix Nagel commented <span data-processor="relativetime" data-value="2020-02-20T11:36:03+00:00" > 02/20/20, 11:36 </span>
> Does my above example not work for you to solve duplicate content for page 1?
No, same issue. Plain list page and page 1 have the same content but different URLs.
Anyway, this should just work out of the box with the Extbase type, shouldn’t it?
-
Christian Hackl commented <span data-processor="relativetime" data-value="2020-02-20T17:00:42+00:00" > 02/20/20, 17:00 </span>
I have a problem, too.
“OneListPlugin” works as expected (on page 0 respectively 1 it doesn’t show the “seite-1” part, but “TwoListPlugin” does not.
TwoListPlugin:
- shows me “domain.tld/seite-3/type-0/area” instead of “domain.tld/seite-3/type-0/area-0” // which is also incorrect because i don’t want “type-0” or “area-0“
- if i go back to page 0 respectively 1 than it gives me 404 and a url like “domain.tld/seite-0/type-0/area” instead of “domain.tld/type-0/area-0”if I set the widget_0 (‘{page-label}-{page}’) to the end of the URL in the YAML config, like:
- { routePath: '/{type-label}-{type}/{area-label}-{area}/{page-label}-{page}', _controller: 'Job::list', _arguments: {'page': '@widget_0/currentPage', 'type': 'types', 'area': 'areas'} }then gives me on click on page 2 a url like: “domain.tld/type-0/area-0/seite-2”.
If I click on page 1 I get a URL like: “domain.tld/type-0/area-0/seite” so without “-0” or “-1” or something.What do I expect?
I would expect that if no arguments (page, types, areas) are set (i.e. 0), they won’t appear in the URL at all – just like with “OneListPlugin”.
And if I click back, i.e. on page 0 respectively 1 then, of course, the argument “page-0” should not appear in the URL.OneListPlugin: type: Extbase extension: ExtName plugin: PluginOne defaultController: 'One::list' routes: - { routePath: '/{page-label}-{page}', _controller: 'One::list', _arguments: {'page': '@widget_0/currentPage'} } defaults: page: '' requirements: page: '\d+' aspects: page: { type: StaticRangeMapper, start: '1', end: '100' } page-label: { type: LocaleModifier, default: 'page', localeMap: [{ locale: 'en_.*', value: 'page' }, { locale: 'de_.*', value: 'seite' }] } ### not working: TwoListPlugin: type: Extbase extension: ExtName plugin: PluginTwo defaultController: 'Two::list' routes: - { routePath: '/{page-label}-{page}/{type-label}{type}/{area-label}{area}', _controller: 'Two::list', _arguments: {'page': '@widget_0/currentPage', 'type': 'types', 'area': 'areas'} } defaults: page: '' type: '' area: '' requirements: page: '\d+' type: '\d+' area: '\d+' aspects: page: { type: StaticRangeMapper, start: '1', end: '100' } page-label: { type: LocaleModifier, default: 'page', localeMap: [{ locale: 'en_.*', value: 'page' }, { locale: 'de_.*', value: 'seite' }] } type-label: { type: LocaleModifier, default: 'type-', localeMap: [] } area-label: { type: LocaleModifier, default: 'area-', localeMap: [] }——
Edit:
forget to mention: I want to filter (html/fluid form) the pagination, these are the 2 values “types” and “areas”.
This works fine so far – just not with the right URL… -
S P commented <span data-processor="relativetime" data-value="2020-02-25T09:52:31+00:00" > 02/25/20, 09:52 </span>
Now that requirements are not considered when an aspect is present a whole of our sites did break.
I have a customly programmed aspect (used in the ExtbasePluginEnhancer) which considered slashes and resolved the URL by itself (by exploding the slashes and finding the correct uid of the dataset). To make this work I did set the requirements to
.*(because teh default requirement[^/]++forbids slashes). We did this to have arbitrarily deep category trees which are represented in the url.This change totally breaks this, because I can not set the requiements anymore. What is the solution for me here?
-
Oliver Bartsch changed Related to #90531 <span data-processor="relativetime" data-value="2020-02-25T10:54:22+00:00" > 02/25/20, 10:54 </span>
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2020-02-27T12:41:55+00:00" > 02/27/20, 12:41 </span> -
Oliver Hader changed Related to #89185 <span data-processor="relativetime" data-value="2020-03-14T17:58:47+00:00" > 03/14/20, 17:58 </span>
-
Moritz Ahl commented <span data-processor="relativetime" data-value="2021-01-28T23:37:04+00:00" > 01/28/21, 23:37 </span>
Can somebody point me to the solution for this? I still have the issue with page 2 pointing to page 1 in 9.5.24 with this configuration:
MyPagination: type: Plugin limitToPages: [ 12163, 12162, 12165] namespace: 'tx_mypagination_page' routePath: 'p/{@widget_0/currentPage}' requirements: page: '\d+' defaults: page: '' aspects: '@widget_0/currentPage': type: StaticRangeMapper start: '1' end: '400'Doesn’t matter what I put in to defaults (empty, 1 or 0). Also, same result using the extbase variant.
-
Eric Chavaillaz commented <span data-processor="relativetime" data-value="2021-07-23T11:23:13+00:00" > 07/23/21, 11:23 </span>
For me it does not work. I do not use the Fluid widget but the new API (SimplePagination).
If I am on page 2, the link to page 1 is “/page/1” (or “/page”) instead of “/”.Not possible to use the “Plugin” enhancer, the query string is like this :
?tx_news_pi1[controller]=News&tx_news_pi1[currentPage]=1&cHash=...My configuration is :
routeEnhancers: News: aspects: page: end: '100' start: '1' type: StaticRangeMapper page-path: default: page localeMap: - locale: fr_.* value: page type: LocaleModifier defaultController: News::list defaults: page: 1 namespace: tx_news_pi1 requirements: page: \d+ routes: - _arguments: page: currentPage _controller: News::list routePath: /{page-path}/{page} type: ExtbaseAny idea?
Thanks -
Emile Blume commented <span data-processor="relativetime" data-value="2021-12-24T09:07:52+00:00" > 12/24/21, 09:07 </span>
I tried to add enhance my paginator to display the right language. For me this worked:
NewsList: type: Plugin namespace: tx_news_pi1 routePath: '/{localized_page}/{@widget_0/currentPage}' aspects: '@widget_0/currentPage': type: StaticRangeMapper start: '1' end: '100' localized_page: type: LocaleModifier default: 'page' localeMap: - locale: 'en_EN.*' value: 'page' - locale: 'nl_NL.*' value: 'pagina' -
Felix Nagel commented <span data-processor="relativetime" data-value="2026-02-12T09:44:02+00:00" > 02/12/26, 09:44 </span>
Still an issue in 13.4 LTS.
Update: the first time (not page 1) I click on the pagebrowser it works, clicking then on another page of the pagebrowser also does not work.