Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
- Follow the example of the text input widget, see \Drupal\typed_data\Plugin\TypedDataFormWidget\TextInputWidget and \Drupal\Tests\typed_data\Functional\TypedDataFormWidget\TextInputWidgetTest
- Add a plugin with id "textarea" which exposes the "rows" option as configuration setting.
- Add a test case
Comments
Comment #2
fagoComment #3
max-kuzomko CreditAttribution: max-kuzomko commentedComment #4
max-kuzomko CreditAttribution: max-kuzomko commentedStarted to work on the last one. Created a pull requests but some tests failed (I think some unit tests and coding standards issues).
I fixed some coding standards issues (errors only).
Could somebody review the PR (remaining coding standards issues + unit tests), have a look at my implementation of textarea widget and give some comments, please?
https://github.com/fago/typed_data/pull/2
Comment #5
fagothx, that looks pretty solid. There is just one small issue which we should improve a bit imo: https://github.com/fago/typed_data/pull/2#pullrequestreview-40382802
Comment #6
freelockDoes this support using text formats/filters?
Comment #7
max-kuzomko CreditAttribution: max-kuzomko commented#5, thanks! Fixed!
Comment #8
max-kuzomko CreditAttribution: max-kuzomko commentedComment #9
fagoWe've still some coding style issues pending - we need to resolve them before we can proceed here with a green build.
Comment #10
max-kuzomko CreditAttribution: max-kuzomko commentedAll checks have passed, please have a look:
https://github.com/fago/typed_data/pull/5
Comment #11
fagothx, that's quite good already, however there is still the issue of applicable data types. Please see https://github.com/fago/typed_data/pull/2#pullrequestreview-48899068
Comment #12
max-kuzomko CreditAttribution: max-kuzomko commentedFixed, please review
Comment #13
fagoThank you, however this needs some work still. See PR.
Comment #14
max-kuzomko CreditAttribution: max-kuzomko as a volunteer commentedThanks @fago.
Please review the updated PR:
https://github.com/fago/typed_data/pull/2
Also there is an answer to your comment:
https://github.com/fago/typed_data/pull/2#discussion_r142030238
Comment #15
fagoAnswered at github, but yeah - exactly this!
Comment #16
max-kuzomko CreditAttribution: max-kuzomko as a volunteer commented@fago, tests failed:
src\Plugin\TypedDataFormWidget\TextareaWidget.php:
Should we do:
instead:
return is_subclass_of($definition->getClass(), StringInterface::class);
Comment #17
fagosure, how else could you make it work as desired? ;)
Comment #18
max-kuzomko CreditAttribution: max-kuzomko as a volunteer commentedThanks! I have updated the PR:
https://github.com/fago/typed_data/pull/2
Please have a look.
Hoverwer, we had a discussion regarding float & integer earlier:
https://github.com/fago/typed_data/pull/2#discussion_r118576386
Comment #19
fago>Hoverwer, we had a discussion regarding float & integer earlier:
https://github.com/fago/typed_data/pull/2#discussion_r118576386
Exactly.
isApplicable and its test case still needs work. As written before, it should have that test:
The implementation needs to be adapted as needed (only allow strings) to follow that desired behaviour!
Comment #20
max-kuzomko CreditAttribution: max-kuzomko as a volunteer commented#19, with the specified testIsApplicable() method tests fails:
Since isApplicable() returns TRUE for the following data types:
datetime_iso8601, uri, duration_iso8601
@fago, should allow the data types above for the textarea widget:
or we have to do not allow it by updating isApplicable() method with something like this:
Comment #23
fagoI just completed the remaining part here + merged it! Thanks!
Comment #24
fago