Review main Merged

73449[BUGFIX] Respect workspace in ajax slug generation

Imko Schumacher CR +2 V +2 Easy +10 −1 updated 04/14/22, 20:54

Commit message

The SlugHelper now receives the current workspace id and applies the
correct workspace constraint.

Review

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

Issues 1

Files 2

Review log 1113

  1. Imko Schumacher uploaded patch set 1 02/12/22, 12:05

  2. core-ci voted on patch set 1 V +1 02/12/22, 12:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23445

  3. Christian Kuhn commented on patch set 1 02/12/22, 13:11

    FormSlugAjaxController.php:112

    context can be injected and probably slughelper, too. btw: great issue report, well written. thx!
  4. Stefan Bürk commented on patch set 1 02/12/22, 13:35

    FormSlugAjaxController.php:112 Reply

    I think we should add tests to cover this issue. Beside's this, same as Christian already said .. and ack, great issue report !
  5. Christian Kuhn commented on patch set 1 02/12/22, 13:38

    FormSlugAjaxController.php:112 Reply

    how to test this, stefan? with an AC test? that'll be quite a bit of work since we don't have ac tests clicking around on workspaces at all, currently ... i'd be fine with picking that patch without test and maybe add workspaces AC coverage later?
  6. Imko Schumacher commented on patch set 1 02/12/22, 13:41

    FormSlugAjaxController.php:112 Reply

    The context is typically used with makeInstance and not injected. If you take a look in "Typo3 Explained" or in the class comment of the context: "For most use-cases, the current main context is fetched via GeneralUtility::makeInstance(Context::class)". The SlugHelper is always specific to the current table, field, config, etc and cannot be injected (as far as I can tell). btw: thx
  7. Imko Schumacher commented on patch set 1 02/12/22, 14:30

    FormSlugAjaxController.php:112 Reply

    Honestly, creating a functional or acceptance test is out of my scope.
  8. Stefan Bürk commented on patch set 1 02/12/22, 17:12

    FormSlugAjaxController.php:112 Reply

    @Christian Kuhn: Sure, AC test without having some workspace related AC tests yet would be a little bit overkill. And at all I don't want to block a bugfix because of adding a bigger test case basic setup which has lacked yet which is outside of this patch at all. Not looked deeper into the AjaxController, but I think we may be able to prepare data for that in a functional test and then calling the "FormAjaxController::suggestAction()" and test the response if the repsonse return the expected json response .. or not ? I think this should be doable.
  9. Stefan Bürk uploaded patch set 2 04/11/22, 19:12

  10. core-ci voted on patch set 2 V +1 04/11/22, 19:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25934

  11. Stefan Bürk commented on patch set 2 V +1 CR +1 04/11/22, 19:24

    Thanks for the patch and the even more greatful bug report.

    FormSlugAjaxController.php:112 Reply

    Yeah, tests needs to much pre-work. So fine to not longer block this bugfix. Made context injected, as already noted SlugHelper is table aware and thus not injectable.
  12. Benni Mack voted on patch set 2 V +2 CR +2 04/14/22, 20:54

  13. Benni Mack merged patch set 3 04/14/22, 20:54