70196[FEATURE] Introduce TCA option "min"
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Christian Kuhn +1
-
Verified V +2 Done
- Stefan Bürk +2
- Christian Kuhn +1
- core-ci +1 CI
Issues 1
Files 17
- Build/Sources/Sass/typo3/_main_form.scss+11 −1
- Build/Sources/TypeScript/backend/form-engine-validation.ts+7 −0
- Build/Sources/TypeScript/backend/form-engine.ts+89 −1
- typo3/sysext/backend/Classes/Form/Element/InputTextElement.php+7 −3
- typo3/sysext/backend/Classes/Form/Element/TextElement.php+7 −2
- typo3/sysext/backend/Classes/Form/AbstractNode.php+3 −0
- typo3/sysext/backend/Classes/Form/FormResultCompiler.php+1 −0
- typo3/sysext/backend/Resources/Public/Css/backend.css+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine-validation.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine.js+1 −1
- typo3/sysext/core/Classes/DataHandling/DataHandler.php+15 −1
- typo3/sysext/core/Documentation/Changelog/12.0/Feature-92861-IntroduceTCAOptionMin.rstnew+37 −0
- typo3/sysext/core/Resources/Private/Language/locallang_core.xlf+3 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Regular/DataSet/MinValuePages.csvnew+3 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Regular/MinValueTest.phpnew+112 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_datahandler/Configuration/TCA/Overrides/tt_content.php+37 −1
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_datahandler/ext_tables.sql+10 −6
Review log 5589
Show 3964 earlier messages
-
Nikita Hovratov uploaded patch set 1 08/03/21, 17:04
-
core-ci voted on patch set 1 V +1 08/03/21, 17:24 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/14055
-
Anja Leichsenring commented on patch set 1 V -1 08/03/21, 17:57
I applied the property to an input field and set it to 6. There also is a max property already, I set it to 12. While probably the functionality is correct, the Backend will not give sufficient support to figure out why validation is not true. The messages only care for the max value, leaving me no chance to see whether or not I already exceeded the min requirement. -
Andreas Kienast commented on patch set 1 CR -1 08/03/21, 18:00
It seems the validation is not triggered when creating a new record. I've modified pages.nav_title, but after creating a new record I'd expect a violation for this field as it's empty.Feature-92861-IntroduceTCAOptionMin.rst:6Please add a new line before this line. -
Nikita Hovratov commented on patch set 1 08/03/21, 18:09
Reply
Empty fields should not be validated this is correct. See here: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/minlength -
Benni Mack commented on patch set 1 08/03/21, 18:27
Hey Nikita, Just a thought: how about having DataHandler also restrict persisting such records with not enough characters? Also, can we cover cases like "0" or multi-byte characters with tests? -
Nikita Hovratov commented on patch set 1 08/05/21, 13:34
@all Maybe we should first decide, what we want to achieve with this option. My though was to simply introduce the minlength html attribute to FormEngine: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/minlength Meaning empty strings are valid. Similar to range.lower for date types, which means no date provided. As the sibling "max" is not validated in DataHandler as well, I thought "min" shouldn't, too. What would happen, if the DataHandler finds an invalid value? Should it be padded with a certain character? I agree that an indicator would be helpful, to see how many characters are missing. This can look similar to the existing remaining characters indicator for the "max" value. -
Nikita Hovratov uploaded patch set 2 08/27/21, 18:02
-
Nikita Hovratov commented on patch set 2 08/27/21, 18:04
Reply
Do you mean if not enough characters were provided, the DataHandler will clear the value? -
core-ci voted on patch set 2 V +1 08/27/21, 18:22 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15749
-
Nikita Hovratov uploaded patch set 3 08/31/21, 13:26
-
core-ci voted on patch set 3 V +1 08/31/21, 13:41 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15935
-
Nikita Hovratov uploaded patch set 4 09/02/21, 07:27
-
core-ci voted on patch set 4 V +1 09/02/21, 07:50 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16048
-
Nikita Hovratov uploaded patch set 5 09/03/21, 14:47
-
core-ci voted on patch set 5 V +1 09/03/21, 15:13 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16198
-
Nikita Hovratov uploaded patch set 6 11/22/21, 16:13
-
core-ci voted on patch set 6 V -1 11/22/21, 16:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19645
-
core-ci commented on patch set 6 11/22/21, 16:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19645
-
Nikita Hovratov uploaded patch set 7 11/23/21, 13:34
-
core-ci voted on patch set 7 V -1 11/23/21, 13:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19676
-
Nikita Hovratov uploaded patch set 8 11/24/21, 19:57
-
core-ci voted on patch set 8 V +1 11/24/21, 20:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19714
-
Oli Bartsch commented on patch set 8 11/25/21, 21:09
Reply
> As the sibling "max" is not validated in DataHandler as well, I thought "min" shouldn't, too. Actually, "max" is checked in DataHandler: https://github.com/TYPO3/typo3/blob/master/typo3/sysext/core/Classes/DataHandling/DataHandler.php#L1699 However, it's not that easy with "min", since adding padding characters is IMO not reasonable. We might just reset the value like it's done for the "eval" checks some lines below? -
Nikita Hovratov commented on patch set 8 11/26/21, 08:33
Reply
Ah ok, didn't look close enough. Just read the docs for text fields: https://docs.typo3.org/m/typo3/reference-tca/master/en-us/ColumnsConfig/Type/Text/Properties/Max.html?highlight=max#confval-max Let's reset the value then. -
Nikita Hovratov uploaded patch set 9 11/26/21, 20:34
-
Nikita Hovratov commented on patch set 9 11/26/21, 20:34
Reply
DoneFeature-92861-IntroduceTCAOptionMin.rst:6ReplyDone -
core-ci voted on patch set 9 V -1 11/26/21, 20:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19832
-
Nikita Hovratov uploaded patch set 10 11/26/21, 21:54
-
core-ci voted on patch set 10 V -1 11/26/21, 22:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19840
-
Nikita Hovratov rebased onto patch set 11 11/27/21, 13:26
-
core-ci voted on patch set 11 V +1 11/27/21, 13:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19859
-
Benni Mack wrote 11/29/21, 10:19
Change destination moved from master to main -
Nikita Hovratov updated the commit message in patch set 12 11/29/21, 11:44
-
core-ci voted on patch set 12 V -1 11/29/21, 11:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19973
-
Nikita Hovratov uploaded patch set 13 12/01/21, 20:11
-
core-ci voted on patch set 13 V -1 12/01/21, 20:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20359
-
Nikita Hovratov uploaded patch set 14 12/01/21, 20:55
-
Christoph Schwob wrote 12/01/21, 21:06
Removed cc Christoph Schwob. -
core-ci voted on patch set 14 V -1 12/01/21, 21:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20367
-
Nikita Hovratov uploaded patch set 15 12/02/21, 08:48
-
core-ci voted on patch set 15 V +1 12/02/21, 09:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20378
-
Benni Mack commented on patch set 15 12/10/21, 08:27
Does this also work for "number"? :) -
Nikita Hovratov uploaded patch set 16 12/18/21, 10:44
-
Nikita Hovratov commented on patch set 16 12/18/21, 10:45
Reply
Added a test case for eval=int -
core-ci voted on patch set 16 V -1 12/18/21, 10:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21233
-
Nikita Hovratov uploaded patch set 17 12/18/21, 11:01
-
core-ci voted on patch set 17 V +1 12/18/21, 11:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21234
-
Nikita Hovratov uploaded patch set 18 01/14/22, 19:02
-
Nikita Hovratov uploaded patch set 19 01/14/22, 19:13
-
Nikita Hovratov uploaded patch set 20 01/14/22, 19:17
-
core-ci voted on patch set 20 V +1 01/14/22, 19:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22088
-
Nikita Hovratov uploaded patch set 21 01/17/22, 17:38
-
core-ci voted on patch set 21 V +1 01/17/22, 17:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22188
-
Nikita Hovratov uploaded patch set 22 01/22/22, 20:56
-
core-ci voted on patch set 22 V +1 01/22/22, 21:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22412
-
Nikita Hovratov uploaded patch set 23 02/12/22, 10:24
-
core-ci voted on patch set 23 V -1 02/12/22, 10:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23442
-
Nikita Hovratov uploaded patch set 24 02/12/22, 16:42
-
core-ci voted on patch set 24 V +1 02/12/22, 16:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23462
-
Nikita Hovratov uploaded patch set 25 02/18/22, 18:42
-
core-ci voted on patch set 25 V +1 02/18/22, 18:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23889
-
Nikita Hovratov uploaded patch set 26 03/24/22, 16:49
-
core-ci voted on patch set 26 V -1 03/24/22, 17:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25103
-
Nikita Hovratov uploaded patch set 27 03/24/22, 17:16
-
core-ci voted on patch set 27 V +1 03/24/22, 17:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25108
-
Nikita Hovratov uploaded patch set 28 04/08/22, 21:20
-
Nikita Hovratov uploaded patch set 29 04/08/22, 21:23
-
core-ci voted on patch set 28 V -1 04/08/22, 21:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25866
-
core-ci voted on patch set 29 V +1 04/08/22, 21:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25868
-
Nikita Hovratov uploaded patch set 30 04/19/22, 12:35
-
core-ci voted on patch set 30 V +1 04/19/22, 12:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26185
-
Simon Schaufelberger uploaded patch set 31 06/10/22, 11:41
-
core-ci voted on patch set 31 V +1 06/10/22, 11:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27916
-
Simon Schaufelberger uploaded patch set 32 07/07/22, 01:36
-
core-ci voted on patch set 32 V +1 07/07/22, 01:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28697
-
Nikita Hovratov commented on patch set 32 07/07/22, 07:09
Thanks for rebasing! -
Anja Leichsenring uploaded patch set 33 08/02/22, 08:57
-
Anja Leichsenring commented on patch set 33 V -1 08/02/22, 09:00
The invalid badge does not look good yet, might be I messed up the rebase. When you activate the test_datahandler extension in a test environment and create a new tt_content record, you can see what happens if you start typing into one of the new fields. Additionally, if I save the record right away, without activating the JS function for the count, I can do that. I am not sure this is expected behavior, but when you define a min value, empty should not be valid IMO. -
core-ci voted on patch set 33 V -1 08/02/22, 09:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29776
-
Anja Leichsenring uploaded patch set 34 08/02/22, 10:07
-
Anja Leichsenring commented on patch set 34 V -1 08/02/22, 10:08
comment still applies, I only fixed failing pipeline jobs. https://review.typo3.org/c/Packages/TYPO3.CMS/+/70196/comments/24565bdb_85dea9db -
core-ci voted on patch set 34 V +1 08/02/22, 10:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29778
-
Nikita Hovratov uploaded patch set 35 08/02/22, 13:03
-
core-ci voted on patch set 35 V +1 08/02/22, 13:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29784
-
Nikita Hovratov commented on patch set 35 08/02/22, 13:12
Reply
Thanks for your review, yes the badge had old bootstrap classes I updated them now. For this min feature, empty values are valid as it should work exactly like for the html attribute "minlength". See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/minlengthReply
It is fixed already, I think you checked an old patchset. -
Christian Kuhn voted on patch set 35 V +1 CR +1 08/02/22, 14:18
-
Stefan Bürk voted on patch set 35 V +2 CR +2 08/03/22, 15:56
-
Stefan Bürk merged patch set 36 08/03/22, 15:56