Project

General

Profile

Actions

Bug #91389

closed

viewhelper f:uri produces broken URLs when used with parameter noCache="1"

Added by Peter Linzenkirchner almost 4 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2020-05-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

This viewhelper:

<f:uri.action pageUid="{subscribeVerifyUid}" extensionName="fpnewsletter" pluginName="pi1" controller="Log" action="verify" arguments="{uid: uid, hash: hash}" noCache="1" absolute="1" />

results in a messed up URI:

https://mydomain.com/newsletter-verify-anmeldung/nc/?tx_fpnewsletter_pi1__action=verify&v47045b4d77d5bcd5075560abef27a6=Log&cHash=4f7788ef8d28686a7c9bd679bc5dd942

When i delete noCache="1" i get:

https://mydomain.com/newsletter-verify-anmeldung/?tx_fpnewsletter_pi1%5Baction%5D=verify&tx_fpnewsletter_pi1%5Bcontroller%5D=Log&cHash=29abd4570bb20da4a0bcad854780f141

which seems correct on first look but is messed up too: the arguments are missing.

I assume this is a side effect from the last update (9.5.17). Until 9.5.16 it worked.

Actions #1

Updated by Peter Linzenkirchner almost 4 years ago

correction:
i made a mistake with the arguments - when i delete noCache="1" the viewhelper works correctly with all arguments. Sorry.

Actions #2

Updated by Oliver Hader almost 4 years ago

  • Status changed from New to Needs Feedback

Thanks for your report and feedback. Does it mean this issue can be closed or are there further problems?
In case there are still problems, please post the relevant parts of your route enhancer configuration. Thx

Actions #3

Updated by Oliver Hader almost 4 years ago

  • Category changed from Fluid to Link Handling, Site Handling & Routing
Actions #4

Updated by Oliver Hader almost 4 years ago

  • Target version set to 9.5.18 & 10.4.3
Actions #5

Updated by Peter Linzenkirchner almost 4 years ago

There is the problem left, that noCache="1" results in a messed up URL.

The route enhancer config:

routeEnhancers:
    NoCacheHandling:
        type: Simple
        routePath: '/{no_cache}'
        requirements:
            no_cache: '.*'
        aspects:
            no_cache:
                type: StaticValueMapper
                map:
                    nc: 1
Actions #6

Updated by Oliver Hader almost 4 years ago

  • Target version deleted (9.5.18 & 10.4.3)
Actions #7

Updated by Benni Mack almost 4 years ago

Peter Linzenkirchner wrote:

There is the problem left, that noCache="1" results in a messed up URL.

Hey Peter,

I actually wrote a blog post about not using no_cache. As it actually builds up the same content with a different URL, you will have duplicated content for SEO reasons, so I would refrain for putting this in the route path.

Actions #8

Updated by Peter Linzenkirchner almost 4 years ago

Hi Benni,

thanks for your answer! I needed it for URLs to AJAX calls, so there was no risk of duplicate urls. But i really needed the content without cache because i needed life data. So i worked around with config.no_cache=1 - no big deal with ajax calls.

But i think the viewhelper should not deliver a destroyed url when noCache="1" is added. I understand that this attribute normally is not usefull anymore, but then it should be ignored by the viewhelper or the viewhelper should throw an exception. It was a bit difficult to find the reason why the urls were so messy ... :-)

Actions #9

Updated by Benni Mack almost 4 years ago

Peter Linzenkirchner wrote:

Hi Benni,

thanks for your answer! I needed it for URLs to AJAX calls, so there was no risk of duplicate urls. But i really needed the content without cache because i needed life data. So i worked around with config.no_cache=1 - no big deal with ajax calls.

But i think the viewhelper should not deliver a destroyed url when noCache="1" is added. I understand that this attribute normally is not usefull anymore, but then it should be ignored by the viewhelper or the viewhelper should throw an exception. It was a bit difficult to find the reason why the urls were so messy ... :-)

Hey Peter,

yes. the underlying issue is that two RouteEnhancer were added and only the no_cache route enhancer worked as it messed up additional URLs.

Actions #10

Updated by Benni Mack over 2 years ago

  • Status changed from Needs Feedback to Closed

I'll close this issue, and keep it is a reference for people who use the same argument in multiple enhancers.

Actions

Also available in: Atom PDF