Issue Bug Closed

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

Peter Linzenkirchner 05/13/20, 21:37 updated 01/06/22, 09:35

Description

This viewhelper:

<f:uri pageuid="{subscribeVerifyUid}" extensionname="fpnewsletter" pluginname="pi1" controller="Log" action="verify" arguments="{uid: uid, hash: hash}" nocache="1" absolute="1"></f:uri>

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.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 10

  1. Peter Linzenkirchner commented 05/14/20, 10:11

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

  2. Oliver Hader commented and changed status New Needs Feedback 05/14/20, 11:09

    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

  3. Oliver Hader changed category 05/14/20, 11:09

  4. Oliver Hader changed target version 05/14/20, 11:23

  5. Peter Linzenkirchner commented 05/14/20, 11:26

    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
  6. Oliver Hader changed target version 05/18/20, 17:48

  7. Benni Mack commented 06/03/20, 16:24

    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.

  8. Peter Linzenkirchner commented 06/03/20, 17:35

    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 … :-)

  9. Benni Mack commented 06/03/20, 20:47

    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.

  10. Benni Mack commented and changed status Needs Feedback Closed 01/06/22, 09:35

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