Review main Merged

70880[TASK] Cover FE index.php id/type parameter requests with tests

Stefan Bürk CR +2 V +2 Easy +49 −0 updated 09/22/21, 19:33

Commit message

Core has been working with id and type as query
parameter to display FE pages and switch between
defined TypoScript page definitions. Speaking url
has been integrated for v9 through the new routing
feature to do it in a more determistic way as in
comparision to ext:realurl.

As there might be instances using id/type query
parameters for ajax call switches (and eventelly
for eid scrips) in the frontend, normalization has
been implemented to keep this option alive (#88028).

Recently there has been a try to fix a bug for so
some use cases, which broke this support (#94537).

For future it should be considered if it is possible
to drop this option in the future to free id/type
query arguments for instances in the frontend.

There a several issues in this area, for example
broken subfolder installation support and id/type
query parameter on a full speaking url overrule
it with selected id, which is not expected.

To validate that the test fails if support is
broken change in PageRouter following line (150):

$urlPath = str_replace($scriptName, '', $urlPath);

to

$urlPath = str_replace( '/' . $scriptName,
    '', $urlPath);

Build/Scripts/runTests.sh -s functional \
typo3/sysext/frontend/Tests/Functional/SiteHandling/\
SiteRequestTest.php

This patch acts as pre-patche to fix these.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Benni Mack +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1216

  1. Stefan Bürk uploaded patch set 1 09/03/21, 09:36

  2. core-ci voted on patch set 1 V +1 09/03/21, 09:50 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16160

  3. Stefan Bürk wrote 09/05/21, 10:36

    Topic set to Routing
  4. Stefan Bürk rebased onto patch set 2 09/05/21, 10:36

  5. core-ci voted on patch set 2 V +1 09/05/21, 10:55 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16286

  6. Benni Mack updated the commit message in patch set 3 09/07/21, 08:13

  7. core-ci voted on patch set 3 V +1 09/07/21, 08:37 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16369

  8. Stefan Bürk rebased onto patch set 4 09/20/21, 21:34

  9. core-ci voted on patch set 4 V +1 09/20/21, 21:51 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16956

  10. Benni Mack voted on patch set 4 V +1 CR +1 09/22/21, 16:00

  11. Oli Bartsch commented on patch set 4 09/22/21, 16:18

    Hi, I checked on v10 and the test fails due to several reasons (e.g. X-Redirect-By, testing framework,..). Would you mind not backporting this?
  12. Stefan Bürk commented on patch set 4 09/22/21, 16:30

    Reply

    Generelly I would like to have the test backported as it acts as a pre-patch. The reason for that is, that I want to provide an bugfix/change, which needs backport than also. There was a try, which went to a regression and has been needed to be reverted, because this test was not in place to cover it. I have a working solution for that bugfix, but would like to have this test added before to ensure it will not break again. Maybe Benni could say more, if we do not backport this (and than the bugfix) and just do them on master/v11. Regarding the failues, they are "expected" because of changes. The header was somewhere implemented in v11/master, v10 do not have it. Besides this the executeFrontedSubRequest() has simply be changed to executeFrontendRequest() - which is needed for all test backports anyway which running frontent requests. And it seems that there was a change for the moint point redirect, that behave differently in v10 compared master/v11 - mainly keeping the type/id query arguements in the redirect. If it is okay, I could provide a backport patch afterwards to do the work; if needed/wanted.
  13. Oli Bartsch commented on patch set 4 09/22/21, 16:54

    Reply

    Oke, I see. What do you think about adding the backport already before merging the master patch? So we can see how difficult it is.
  14. Stefan Bürk commented on patch set 4 09/22/21, 17:47

    Reply

    Not really hard. Had done this a couple of time locally already to test it. But there it is. Just took time to search where the "changed" behavior come from, which needed to be addressed in the backport: 1. FrontendSubRequest is new v11 feature, so backport needs to use FrontendRequest 2. X-Redirect header has been implemented through: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65752 Regarding the type parame which is added on redirect in v10 I do not know/found when it was added. But v10 behaves so.
  15. Oli Bartsch commented on patch set 4 V +2 CR +2 09/22/21, 19:33

    Reply

    Ack
  16. Oli Bartsch merged patch set 5 09/22/21, 19:33