Review main Merged Breaking

74924[!!!][FEATURE] Add search for form manager

Josua Vogel CR +2 V +2 Normal +166 −13 updated 07/06/23, 16:56

Commit message

A search form is added to the form manger
to search a form definition by name or persistenceIdentifier.

Because interface :php:`TYPO3\CMS\Form\Mvc\Persistence\FormPersistenceManagerInterface`
is extended, this is marked as breaking change.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Frank Nägler +1
  • Verified V +2 Done
    • Benni Mack +2
    • Frank Nägler +1
    • core-ci +1 CI

Issues 1

Files 8

Review log 5472

Show 3647 earlier messages
  1. Josua Vogel uploaded patch set 1 06/17/22, 11:12

  2. core-ci voted on patch set 1 V -1 06/17/22, 11:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28135

  3. Josua Vogel uploaded patch set 2 06/17/22, 11:50

  4. core-ci voted on patch set 2 V +1 06/17/22, 11:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28137

  5. Björn Jacob commented on patch set 2 CR -1 06/17/22, 14:55

    Awesome contribution Josua. We are having another sprint end of June. Can you please take care to add a feature.rst file (see https://forger.typo3.com/utilities/rst)? Thx mate!
  6. Josua Vogel uploaded patch set 3 06/20/22, 12:20

  7. Josua Vogel commented on patch set 3 06/20/22, 12:22

    Reply

    Hi Björn, the ReST Helper seems to be broken today, but I added the changelog file by myself. Hope everything is okay.
  8. core-ci voted on patch set 3 V +1 06/20/22, 12:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28257

  9. Sybille Peters commented on patch set 3 V +1 CR +1 06/29/22, 21:45

    Created several form, manually set limit to 2 to test pagination. Works nicely 😊

    FormManagerController.php:408

    Minor nitpick: perhaps add a linebreak here.
  10. Elias Häußler commented on patch set 3 06/30/22, 07:28

    FormManagerController.php:408

    Other searches in backend perform a `trim($searchTerm)` before searching. I'd suggest to do this here as well. The condition can then be more strict: <pre> trim($searchTerm) === '' </pre> The `trim()` should probably be done outside of the `foreach()` for performance reasons.
  11. Tobias Jungmann commented on patch set 3 06/30/22, 07:29

    FormManagerController.php:408

    Perhaps it's more efficient to set a reversed if clause with a `continue` command above line 397 to skip the code at 397 to 407. Or am I missing something?

    Index.html:18

    Indentation seems to be at 8 characters (should be 4?)
  12. Björn Jacob commented on patch set 3 CR -1 07/01/22, 07:36

    Maybe @Josua can improve the patch a little bit :) Thx!
  13. Simon Schaufelberger commented on patch set 3 CR -1 07/01/22, 18:46

    The search form should only be shown if there are some forms available, otherwise it doesn't make sense to show a search field.
  14. Simon Schaufelberger uploaded patch set 4 07/05/22, 00:29

  15. Simon Schaufelberger commented on patch set 4 07/05/22, 00:30

    FormManagerController.php:408 Reply

    Done

    FormManagerController.php:408 Reply

    Done

    FormManagerController.php:408 Reply

    I don't understand what you are thinking about. Could you please suggest a code snippet?

    Index.html:18 Reply

    Done
  16. Simon Schaufelberger commented on patch set 4 V +1 CR +1 07/05/22, 00:31

    Reply

    Done
  17. core-ci voted on patch set 4 V +1 07/05/22, 00:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28646

  18. Simon Schaufelberger uploaded patch set 5 07/05/22, 00:37

  19. Simon Schaufelberger uploaded patch set 6 07/05/22, 00:38

  20. Simon Schaufelberger voted on patch set 6 V +1 CR +1 07/05/22, 00:39

  21. core-ci voted on patch set 5 V +1 07/05/22, 00:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28647

  22. core-ci voted on patch set 6 V +1 07/05/22, 00:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28648

  23. Tobias Jungmann commented on patch set 6 07/05/22, 06:31

    FormManagerController.php:408 Reply

    Maybe something like this: ``` foreach ($this->formPersistenceManager->listForms() as $formDefinition) { if (!($searchTerm === '' || $this->valueContainsSearchTerm($formDefinition['name'], $searchTerm) || $this->valueContainsSearchTerm($formDefinition['persistenceIdentifier'], $searchTerm)) ) { continue; } $referenceCount = 0; if ( isset($formDefinition['fileUid']) && array_key_exists($formDefinition['fileUid'], $allReferencesForFileUid) ) { $referenceCount = $allReferencesForFileUid[$formDefinition['fileUid']]; } elseif (array_key_exists($formDefinition['persistenceIdentifier'], $allReferencesForPersistenceIdentifier)) { $referenceCount = $allReferencesForPersistenceIdentifier[$formDefinition['persistenceIdentifier']]; } $formDefinition['referenceCount'] = $referenceCount; $availableFormDefinitions[] = $formDefinition; } ```
  24. Simon Schaufelberger commented on patch set 6 07/05/22, 11:19

    FormManagerController.php:408 Reply

    a much nicer version would be to use array_filter in this case because this negated thing is hard to understand in your brain.
  25. Guido Schmechel commented on patch set 6 07/08/22, 23:06

    Nice feature! Can you please also note the shortcut button? Line 532: add setArguments($arguments) -> initializeModuleTemplate() The arguments can be put together something like this: $arguments = [ 'tx_form_web_formformbuilder' => [ 'searchTerm' => $searchTerm, 'controller' => 'FormManager', 'page' => $arrayPaginator->getCurrentPageNumber() ] ];
  26. Guido Schmechel commented on patch set 6 07/08/22, 23:09

    Reply

    When I search for something and find nothing, I get a hint. Here you could design the text a little better. In addition, the search box is lost and you have to click on "Forms" in the menu on the left again.
  27. Simon Schaufelberger commented on patch set 6 07/08/22, 23:22

    Reply

    Oh, good catch! The form was always visible before even if there were no forms at all which doesn't make sense then to search but yes, there is also the case that the search result is empty.
  28. Simon Schaufelberger wrote 07/09/22, 02:01

    Removed Verified+1 by Simon Schaufelberger
  29. Simon Schaufelberger wrote 07/09/22, 02:01

    Removed Code-Review+1 by Simon Schaufelberger
  30. Josua Vogel uploaded patch set 7 08/16/22, 08:39

  31. Josua Vogel commented on patch set 7 08/16/22, 08:41

    Reply

    Done
    Hi, I changed this
  32. Josua Vogel commented on patch set 7 08/16/22, 08:47

    FormManagerController.php:408 Reply

    Where do you want to use array_filter? Should $availableFormDefinitions contain all form definitions first and then filter by search term?
  33. core-ci voted on patch set 7 V -1 08/16/22, 08:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30190

  34. Josua Vogel uploaded patch set 8 08/16/22, 08:58

  35. core-ci voted on patch set 8 V +1 08/16/22, 09:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30193

  36. Simon Schaufelberger commented on patch set 8 V +1 CR +1 08/16/22, 13:49

    FormManagerController.php:408 Reply

    let's leave it as it is.
  37. Simon Schaufelberger uploaded patch set 9 08/16/22, 13:52

  38. Simon Schaufelberger voted on patch set 9 V +1 CR +1 08/16/22, 13:53

  39. core-ci voted on patch set 9 V +1 08/16/22, 14:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30206

  40. Josua Vogel commented on patch set 9 09/02/22, 12:11

    Please look again at this merge request
  41. Chris Müller uploaded patch set 10 10/21/22, 09:51

  42. core-ci voted on patch set 10 V +1 10/21/22, 10:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32575

  43. Andreas Kienast commented on patch set 10 10/21/22, 10:48

    I know I'm pretty late to that party, but is it possible to extract the search handling (in the end to get the results) into a service class? This would be a fine addition to https://review.typo3.org/c/Packages/TYPO3.CMS/+/76118.
  44. Josua Vogel commented on patch set 10 11/07/22, 13:40

    Reply

    Would be possible. What is the opinion of the forms team? Is this a great addition or too much?
  45. Benni Mack commented on patch set 10 11/15/22, 22:21

    ping here again, feedback from EXT:form responsible people is highly appreciated here.
  46. Chris Müller uploaded patch set 11 V +1 12/07/22, 18:35

  47. core-ci voted on patch set 11 V +1 12/07/22, 18:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34772

  1. Benni Mack commented on patch set 11 12/21/22, 23:11

    Next ping? Is there a decision on this feature from the Form Framework team?
  2. Benni Mack commented on patch set 12 V +1 02/08/23, 07:50

    Published edit on patch set 11.
  3. core-ci voted on patch set 12 V -1 02/08/23, 08:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37329

  4. Benni Mack wrote 02/10/23, 08:12

    Removed cc Benni Mack.
  5. Andreas Kienast wrote 02/10/23, 09:26

    Removed cc Andreas Kienast.
  6. Josua Vogel uploaded patch set 13 V -1 02/24/23, 11:34

  7. core-ci voted on patch set 13 V +1 02/24/23, 11:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38048

  8. Guido Schmechel uploaded patch set 14 V +1 03/25/23, 12:21

  9. Guido Schmechel commented on patch set 14 03/25/23, 12:28

    Independently of the search handling, a button has been added that removes the filter/search word. Comparable to EXT:redirects for non-hits.
  10. Guido Schmechel rebased onto patch set 15 03/25/23, 13:05

  11. core-ci voted on patch set 15 V +1 03/25/23, 13:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39629

  12. core-ci voted on patch set 14 V -1 03/25/23, 13:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39628

  13. Simon Schaufelberger voted on patch set 15 V +1 CR +1 03/27/23, 10:16

  14. Simon Schaufelberger uploaded patch set 16 CR +1 V +1 06/29/23, 05:13

  15. core-ci voted on patch set 16 V +1 06/29/23, 05:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43093

  16. Benni Mack uploaded patch set 17 V +1 07/06/23, 10:23

  17. Benni Mack voted on patch set 17 CR +1 07/06/23, 10:23

  18. Benni Mack commented on patch set 17 V +1 CR 0 07/06/23, 10:23

    works for me
  19. core-ci voted on patch set 17 V +1 07/06/23, 10:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43687

  20. Benni Mack uploaded patch set 18 V +1 07/06/23, 16:14

  21. core-ci voted on patch set 18 V +1 07/06/23, 16:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43773

  22. Benni Mack voted on patch set 18 V +1 CR +1 07/06/23, 16:27

  23. Frank Nägler voted on patch set 18 V +1 CR +1 07/06/23, 16:54

  24. Benni Mack voted on patch set 18 V +2 CR +2 07/06/23, 16:56

  25. Benni Mack merged patch set 19 07/06/23, 16:56