Review main Merged

81303[FEATURE] Allow redirect filtering by "protected" state

Torben Hansen CR +2 V +2 Normal +166 −28 updated 10/05/23, 08:50

Commit message

The redirects module does currently not allow to filter redirects
based on the `protected` state. This making it hard to effectively
administrate protected redirects on websites with a huge amount of
redirects.

This change introduces a new filter option in the redirect
administration module which makes it possible to filter redirects
based on the `protected` state.

Protected redirects are now also visually highlighted by a lock-icon
in the list of redirects.

Additionally, unit- and functional-tests have been extended to
cover redirect filtering based on the `creation_type` and
`protected` state.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 12

Review log 1420

  1. Torben Hansen uploaded patch set 1 09/30/23, 12:48

  2. core-ci voted on patch set 1 V -1 09/30/23, 12:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47319

  3. Chris Müller uploaded patch set 2 V -1 09/30/23, 16:38

  4. Chris Müller uploaded patch set 3 09/30/23, 16:41

  5. core-ci voted on patch set 2 V -1 09/30/23, 16:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47320

  6. core-ci voted on patch set 3 V -1 09/30/23, 16:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47321

  7. Torben Hansen uploaded patch set 4 V -1 10/01/23, 05:36

  8. core-ci voted on patch set 4 V +1 10/01/23, 05:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47325

  9. Garvin Hicking commented on patch set 4 10/02/23, 16:44

    Looks good to me, but I only read the code, couldn't test this yet, but maybe some feedback is helpful :-)

    Feature-102072-AllowRedirectFilteringByProtectedState.rst:6

    May be self-explanatory for many people, but I haven't worked much with redirects (yet) - so I wonder, what are "protected" redirects? Ones that can never be modified/deleted again? Maybe one short sentence or an addition in parantheses could quickly shed light on the question "what is a protected redirect"?

    Demand.php:128

    Would that mean when invoked from a CLI, where previously both protected and unprotected redirects were yielded, this now only yields unprotected ones? Could that be a BC-break worth noting, and it may be set to "-1" at this point? And/or add a getOption() possibility for this? (Disregard please if what I'm asking is nonsense, just trying to read the code)

    RedirectRepositoryTest.php:188

    Is this maybe missing the $protected demand property?
  10. Torben Hansen uploaded patch set 5 V +1 10/03/23, 04:47

  11. Torben Hansen commented on patch set 4 10/03/23, 04:48

    Feature-102072-AllowRedirectFilteringByProtectedState.rst:6 Reply

    A protected redirect is excluded from automatic deletion (see https://docs.typo3.org/c/typo3/cms-redirects/main/en-us/Usage/Index.html#confval-Protected). Added a short addition in the description of the feature.

    Demand.php:128 Reply

    I removed this again, so users using this method will not have a `0` as default for the protected property in the demand object. Currently, this method is only used once for the CLI redirects cleanup task, which only processes non protected redirects (see hardcoded constraint in `RedirectRepository->removeByDemand()`)

    RedirectRepositoryTest.php:188 Reply

    No, we do not need it here, since the method is only used to create Demand objects for the `removeByDemandWorks` tests, which only processes redirects that are not protected (see hardcoded constraint in `RedirectRepository->removeByDemand()`)
  12. core-ci voted on patch set 5 V +1 10/03/23, 04:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47364

  13. Garvin Hicking commented on patch set 5 V +1 CR +1 10/03/23, 09:04

    Great, thanks for the explanations and changes! I just tested it, works well for me!
  14. Stefan Bürk commented on patch set 5 CR -1 10/05/23, 08:21

    on it ...

    RedirectRepository.php:139

    We should not use the PDO constants directly. Instead `Connection::PARAM_*` constants should be used. We had a sanitatzion patch for that, however the one for the creation type slipped in - I already detected that for the POC doctrine/dbal upgrade work.
  15. Stefan Bürk uploaded patch set 6 CR +1 V +1 10/05/23, 08:29

  16. Stefan Bürk commented on patch set 6 10/05/23, 08:29

    RedirectRepository.php:139 Reply

    Done
  17. Garvin Hicking voted on patch set 6 V +1 CR +1 10/05/23, 08:35

  18. core-ci voted on patch set 6 V +1 10/05/23, 08:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47423

  19. Stefan Bürk voted on patch set 6 V +2 CR +2 10/05/23, 08:50

  20. Stefan Bürk merged patch set 7 10/05/23, 08:50