Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
With #1742734: [META] Widgets as Plugins, field widgets are now handled using the plugin system. The field example widget definition should be changed to reflect this.
Relevant change notices:
https://drupal.org/node/2064123
https://drupal.org/node/1805846
https://drupal.org/node/1796000
Comment | File | Size | Author |
---|---|---|---|
#35 | interdiff.txt | 55.31 KB | Mile23 |
#35 | 1796606_35.patch | 30.06 KB | Mile23 |
#31 | examples-field_example-1796606-31.patch | 33.58 KB | spiffl |
#21 | examples-adapttoalpha10-1796606-21.patch | 30.41 KB | spiffl |
#18 | 1796606_18.patch | 24.28 KB | Mile23 |
Comments
Comment #1
rfayExcellent... However, first the Field Example will have to be ported to D8 to begin with. It's OK if this issue prompts that, as long as things have stabilized enough.
Comment #2
Mile23We've got #1229322: hook_field_access example/explanation and #1293104: 3text field validation fundamentally flawed in the way.
I'm poking around on the former.
I'd say we need to wait until at least feature freeze on D8 before making examples. Unless of course any of the D8 devs want to start the ball rolling on their respective APIs. :-)
Comment #3
Mile23Marking as postponed for now: #1861598: Examples for Drupal 8 needs relatively stable feature set
Please continue development and discussion as desired.
Comment #4
Mile23Comment #5
Mile23Comment #6
kerasai CreditAttribution: kerasai commentedHi folks,
Attached it is a first shot at field_examples implemented in D8. It'a pretty much just a straight port of the D7 functionality in the shiny, new D8 ecosystem. This should be pretty close, please take a look and provide feedback.
Things that definitely still need to be addressed:
Also, I'm pushing into a repo on Github for my own convenience. https://github.com/kerasai/drupal-examples/tree/8.x-1.x-field_example if anyone is interested.
Comment #7
kerasai CreditAttribution: kerasai commentedForgot to add in the page that the module provided which had some info about the example. Now included.
Comment #8
marvil07 CreditAttribution: marvil07 commentedPatch does not contains the original test.
Following a patch adding them, not finished tough.
Also, based on not having the test, I would suggest to do a full review comparing with D7 version.
Comment #9
marvil07 CreditAttribution: marvil07 commentedNew changes on this
commitpatch:Comment #10
marvil07 CreditAttribution: marvil07 commentedSorry I added the wrong patch, last one was the interdiff.
Re-uploading what is mentioned on last comment.
Comment #12
Enxebre CreditAttribution: Enxebre commentedHi,
Renaming folders according core modules (FieldFormatter, FieldWidget, FieldType )
Fixing values passed to viewElements method.
Fixing use of wrong namespaces
Using \Drupal::formBuilder()->setValue and \Drupal::formBuilder()->setError instead of old deprecated functions.
Comment #13
Enxebre CreditAttribution: Enxebre commentedComment #16
Enxebre CreditAttribution: Enxebre commentedComment #17
Mile23Comment #18
Mile23This patch (mostly) works in the UI now. The tests still don't pass, and I assume the validation routines are still not happening.
Comment #21
spiffl CreditAttribution: spiffl commentedmade some changes to make it work on alpha10.
Comment #22
spiffl CreditAttribution: spiffl commentedfixed the issue in colorpicker that the jquery-class-name was not assigned anymore and cleanup up coding standard errors.
Comment #25
spiffl CreditAttribution: spiffl commentedincorporated latest API Changes from drupal HEAD + moved comon test-baseclass outsite the Tests-namespace
Comment #27
spiffl CreditAttribution: spiffl commentedexamples-field_example-1796606-23.patch is ready for a review
Comment #29
Mile23If you name your interdiff with .txt as the extension, the testbot will ignore it.
Seems like the documentation is still out of date...
See: #2223291: Change all hook_menu() implementations to *.menu_links.yml files, add tests
Comment #30
Mile23Comment #31
spiffl CreditAttribution: spiffl commentedBoth points from #29 are now adapted + both validate functions are now moved to the Widget classes.
Comment #32
spiffl CreditAttribution: spiffl commentedComment #34
Mile2331: examples-field_example-1796606-31.patch queued for re-testing.
Comment #35
Mile23PSR-4, coding standards... interdiff from #31.
This is pretty close.
Comment #37
Mile23Committed! http://cgit.drupalcode.org/examples/commit/?h=8.x-1.x&id=41768a807882f7e...
Thanks, everyone, and especially kerasai for getting the ball rolling.