Review main Merged

75406[TASK] Sort table and field list in DB Check module by labels

Marcin Sągol CR +2 V +2 Easy +21 −13 updated 01/19/24, 12:22

Commit message

When we use DB Check module and our project has large number of
tables configured in the TCA it is often hard to quickly find on the
select list the one we are interested with.

This commit adds small changes to `DatabaseIntegrityController` to:
- sort (ASC) available tables list by table label
- if table label is not defined, use raw table name wrapped with [...]
- sort (ASC) fields defined for table by their labels
- if field label is not defined, [FIELD: xxx] is used as before

Examples for table label

$GLOBALS['TCA']['sys_file']['title'] = 'Label';
- result without debug mode enabled in the BE: 'Label'
- result with debug mode disabled in BE: 'Label [sys_file]'

$GLOBALS['TCA']['sys_file']['title'] = '';
- result without debug mode enabled in the BE: '[sys_file]'
- result with debug mode disabled in BE: '[sys_file]'

Examples for field label

$GLOBALS['TCA']['sys_file']['title']['columns']['field']['label'] = 'Label';
- result without debug mode enabled in the BE: 'Label'
- result with debug mode disabled in BE: 'Label [field]'

$GLOBALS['TCA']['sys_file']['title']['columns']['field']['label'] = '';
- result without debug mode enabled in the BE: '[FIELD: field]'
- result with debug mode disabled in BE: '[FIELD: field] [field]'

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Xavier Perseguers +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • core-ci +1 CI

Issues 1

Files 1

Review log 2638

Show 813 earlier messages
  1. Marcin Sągol uploaded patch set 1 08/09/22, 20:55

  2. core-ci voted on patch set 1 V +1 08/09/22, 21:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29989

  3. Marcin Sągol uploaded patch set 2 08/09/22, 21:06

  4. Marcin Sągol updated the commit message in patch set 3 08/09/22, 21:07

  5. core-ci voted on patch set 3 V +1 08/09/22, 21:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29991

  6. core-ci voted on patch set 2 V +1 08/09/22, 21:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29990

  7. Marcin Sągol updated the commit message in patch set 4 08/09/22, 21:24

  8. core-ci voted on patch set 4 V +1 08/09/22, 21:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29992

  9. Simon Schaufelberger commented on patch set 4 08/09/22, 22:43

    QueryGenerator.php:2277

    Changing the signtature is breaking in this case as someone could potentially extend this method and then have a broken system. Changes are very low but these are the rules of the core.

    TSconfig.rst:171

    Since you introduce a new setting, I consider this a FEATURE
  10. Anja Leichsenring commented on patch set 4 08/10/22, 05:39

    No amount of 'I want that in v11' does this not make a feature, as already mentioned in Slack. Please adjust the Tag and the releases line accordingly, and add a feature.rst file to the patch, to give the new configuration setting the stage it deserves.
  11. Marcin Sągol updated the commit message in patch set 5 08/10/22, 07:01

  12. core-ci voted on patch set 5 V +1 08/10/22, 07:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29996

  13. Tymoteusz Motylewski commented on patch set 5 08/10/22, 07:33

    from my pov this should not be made configurable but a default. and then could be made as a bugfix (but not necesarily backported to v11) or do you see any usecase / advantage of having the table names without order?
  1. Andreas Kienast commented on patch set 5 08/10/22, 08:23

    QueryGenerator.php:2277 Reply

    This class is explicitly marked as "internal", so this is no breaking change by our rules.
  2. Xavier Perseguers commented on patch set 5 09/14/22, 07:07

    QueryGenerator.php:2282

    Looks to me that logically speaking, the handling of an empty table label that you do on line 2295 here after (`$label ?: $tableName`) should better be done here while computing the mapping between table name and its label, so that sorting with `asort` is effectively taken into account in all cases.
  3. Simon Schaufelberger commented on patch set 5 08/24/23, 15:00

    Marcin, can you please update this patch if you still want this to be in the core?
  4. Marcin Sągol commented on patch set 5 09/19/23, 12:01

    Reply Unresolved

    Following the described way or make it (sorting) default?
  5. Simon Schaufelberger commented on patch set 5 09/19/23, 12:59

    QueryGenerator.php:2277 Reply

    Done
  6. Simon Schaufelberger commented on patch set 5 09/19/23, 13:00

    TSconfig.rst:171 Reply

    Done
  7. Marcin Sągol uploaded patch set 6 V +1 11/13/23, 14:10

  8. Marcin Sągol updated the commit message in patch set 7 11/13/23, 14:12

  9. Marcin Sągol updated the commit message in patch set 8 11/13/23, 14:14

  10. Marcin Sągol updated the commit message in patch set 9 11/13/23, 14:18

  11. Marcin Sągol updated the commit message in patch set 10 11/13/23, 14:21

  12. core-ci voted on patch set 6 V +1 11/13/23, 14:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48851

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

  14. core-ci voted on patch set 9 V +1 11/13/23, 14:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48854

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

  16. core-ci voted on patch set 8 V +1 11/13/23, 14:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48853

  17. Marcin Sągol commented on patch set 10 11/14/23, 08:28

    QueryGenerator.php:2282 Reply

    Ack
  18. Marcin Sągol rebased onto patch set 11 V +1 01/19/24, 05:32

  19. core-ci voted on patch set 11 V +1 01/19/24, 05:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51789

  20. Xavier Perseguers updated the commit message in patch set 12 V +1 01/19/24, 06:05

  21. Xavier Perseguers voted on patch set 12 CR +1 01/19/24, 06:07

  22. core-ci voted on patch set 12 V +1 01/19/24, 06:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51790

  23. Andreas Kienast voted on patch set 12 CR +1 01/19/24, 12:11

  24. Andreas Kienast voted on patch set 12 CR +2 V +2 01/19/24, 12:14

  25. Andreas Kienast merged patch set 13 01/19/24, 12:22