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

Files: 
CommentFileSizeAuthor
#25 interdiff-1796606-18-23.patch25.08 KBspiffl
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch interdiff-1796606-18-23.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#25 examples-field_example-1796606-23.patch33.05 KBspiffl
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 570 pass(es).
[ View ]
#22 interdiff-1796606-18-22.patch24.75 KBspiffl
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch interdiff-1796606-18-22.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#22 1796606_22.patch32.87 KBspiffl
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 536 pass(es), 51 fail(s), and 10 exception(s).
[ View ]
#21 examples-adapttoalpha10-1796606-21.patch30.41 KBspiffl
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 536 pass(es), 51 fail(s), and 10 exception(s).
[ View ]
#18 1796606_18.patch24.28 KBMile23
FAILED: [[SimpleTest]]: [MySQL] 223 pass(es), 44 fail(s), and 1 exception(s).
[ View ]
#18 interdiff.txt5.73 KBMile23
#12 interdiff.1796606-10-12.txt48.32 KBEnxebre
#12 examples.field-example.1796606-12.patch23.97 KBEnxebre
FAILED: [[SimpleTest]]: [MySQL] 223 pass(es), 44 fail(s), and 1 exception(s).
[ View ]
#10 examples.field-example.1796606-9.patch24.33 KBmarvil07
FAILED: [[SimpleTest]]: [MySQL] 173 pass(es), 44 fail(s), and 1 exception(s).
[ View ]
#10 interdiff.txt8.65 KBmarvil07
#9 examples.field-example.1796606-9.patch8.65 KBmarvil07
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch examples.field-example.1796606-9.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#7 examples.field-example.1796606-7.patch17.88 KBkerasai
PASSED: [[SimpleTest]]: [MySQL] 165 pass(es).
[ View ]
#7 interdiff.txt2.19 KBkerasai
#6 examples.field-example.1796606-6.patch16.04 KBkerasai
FAILED: [[SimpleTest]]: [MySQL] 164 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Comments

Excellent... 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.

We'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. :-)

Marking as postponed for now: #1861598: Examples for Drupal 8 needs relatively stable feature set

Please continue development and discussion as desired.

Status:Active» Postponed

Status:Postponed» Needs work

Title:Convert field example widgets to the new plugin systemD8 Port: field_examples
Status:Needs work» Needs review
Issue tags:+D8CX
StatusFileSize
new16.04 KB
FAILED: [[SimpleTest]]: [MySQL] 164 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Hi 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:

  1. I'm not real clear on how the schema delcaration in field_example.schema.yml is supposed to be. It works, but I'm not very confident that it's right.
  2. Doc blocks need updating. I started, but realized I wasn't up for rewriting the big chunk in the .module file right now. Formatters and widgets should be easy.

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.

Title:D8 Port: field_examplesD8 Port: field_example
StatusFileSize
new2.19 KB
new17.88 KB
PASSED: [[SimpleTest]]: [MySQL] 165 pass(es).
[ View ]

Forgot to add in the page that the module provided which had some info about the example. Now included.

Assigned:Unassigned» marvil07
Status:Needs review» Needs work

Patch 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.

Assigned:marvil07» Unassigned
Status:Needs work» Needs review
StatusFileSize
new8.65 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch examples.field-example.1796606-9.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

New changes on this commit patch:

  • Remove hook_menu in favor or routing.
  • Re-add test class
  • Routing uses now path instead of pattern as key(see core's 7cfa38d01ad6f7ec747e1a2f77dc53b07679398c).
  • Follow core drupalPost rename for forms (see core's d009cac09c57f6d7e37a5d20aa87676fab959210).
  • minor initial changes to test.

StatusFileSize
new8.65 KB
new24.33 KB
FAILED: [[SimpleTest]]: [MySQL] 173 pass(es), 44 fail(s), and 1 exception(s).
[ View ]

Sorry I added the wrong patch, last one was the interdiff.

Re-uploading what is mentioned on last comment.

Status:Needs review» Needs work

The last submitted patch, 9: examples.field-example.1796606-9.patch, failed testing.

Issue summary:View changes
StatusFileSize
new23.97 KB
FAILED: [[SimpleTest]]: [MySQL] 223 pass(es), 44 fail(s), and 1 exception(s).
[ View ]
new48.32 KB

Hi,
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.

Status:Needs work» Needs review

The last submitted patch, 12: examples.field-example.1796606-12.patch, failed testing.

The last submitted patch, 12: examples.field-example.1796606-12.patch, failed testing.

Assigned:Unassigned» Enxebre

Issue summary:View changes

StatusFileSize
new5.73 KB
new24.28 KB
FAILED: [[SimpleTest]]: [MySQL] 223 pass(es), 44 fail(s), and 1 exception(s).
[ View ]

This patch (mostly) works in the UI now. The tests still don't pass, and I assume the validation routines are still not happening.

Status:Needs review» Needs work

The last submitted patch, 18: 1796606_18.patch, failed testing.

The last submitted patch, 18: 1796606_18.patch, failed testing.

StatusFileSize
new30.41 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 536 pass(es), 51 fail(s), and 10 exception(s).
[ View ]

made some changes to make it work on alpha10.

Assigned:Enxebre» spiffl
Status:Needs work» Needs review
StatusFileSize
new32.87 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 536 pass(es), 51 fail(s), and 10 exception(s).
[ View ]
new24.75 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch interdiff-1796606-18-22.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

fixed the issue in colorpicker that the jquery-class-name was not assigned anymore and cleanup up coding standard errors.

Status:Needs review» Needs work

The last submitted patch, 22: interdiff-1796606-18-22.patch, failed testing.

The last submitted patch, 22: 1796606_22.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new33.05 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 570 pass(es).
[ View ]
new25.08 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch interdiff-1796606-18-23.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

incorporated latest API Changes from drupal HEAD + moved comon test-baseclass outsite the Tests-namespace

Status:Needs review» Needs work

The last submitted patch, 25: interdiff-1796606-18-23.patch, failed testing.

Assigned:spiffl» Unassigned
Status:Needs work» Needs review

examples-field_example-1796606-23.patch is ready for a review

The last submitted patch, 21: examples-adapttoalpha10-1796606-21.patch, failed testing.

If you name your interdiff with .txt as the extension, the testbot will ignore it.

  1. +++ b/field_example/field_example.module
    @@ -0,0 +1,125 @@
    + * - Defining a formatter for the field (the portion that outputs the field for
    + *   display):
    + *   - hook_field_formatter_info()
    + *   - hook_field_formatter_view()
    + *
    + * - Defining a widget for the edit form:
    + *   - hook_field_widget_info()
    + *   - hook_field_widget_form()

    Seems like the documentation is still out of date...

  2. +++ b/field_example/field_example.module
    @@ -0,0 +1,125 @@
    + * Implements hook_menu().

    See: #2223291: Change all hook_menu() implementations to *.menu_links.yml files, add tests

Status:Needs review» Needs work