Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Issue tags: +Field API

tagging

dawehner’s picture

Status: Active » Needs review
FileSize
20.93 KB

There we go.

yched’s picture

Status: Needs review » Needs work

Yay ! Thanks a lot for this :-)

+++ b/core/modules/field/lib/Drupal/field/Annotation/FieldWidget.phpundefined
@@ -0,0 +1,90 @@
+ * Widgets handle the form of fields.

A bit shaky :-).
Maybe "Widgets handle how fields are displayed in edit forms" ?

+++ b/core/modules/field/lib/Drupal/field/Annotation/FieldWidget.phpundefined
@@ -0,0 +1,90 @@
+ * Additional annotation keys for formatters can be defined in
+ * hook_field_formatter_info_alter().

s/formatter/widget/ :-)

+++ b/core/modules/field/lib/Drupal/field/Annotation/FieldWidget.phpundefined
@@ -0,0 +1,90 @@
+  /**
+   * The name of the module providing the widget.
+   *
+   * @var string
+   */
+  public $module;

I think there was some movement on that front while I was afk - where do we stand with those now, isn't that automatically added ?

+++ b/core/modules/field/lib/Drupal/field/Annotation/FieldWidget.phpundefined
@@ -0,0 +1,90 @@
+   * The name of the widget formatter class.

"The name of the widget class" ?

+++ b/core/modules/field/lib/Drupal/field/Annotation/FieldWidget.phpundefined
@@ -0,0 +1,90 @@
+  /**
+   * Does the field widget handles multiple values at once.
+   *
+   * @var array
+   */
+  public $multiple_values = FALSE;

@var boolean :-p

Additionally, we support an optional "weight" property (currently only used by HiddenWidget AFAIK, that's the specific case for which the propery was introduced). The doc for that in hook_field_widget_info() (before the "Widgets as plugins" patch) was :
"weight: (optional) An integer to determine the weight of this widget relative to other widgets in the Field UI when selecting a widget for a given field instance".
It should default to NULL, though.

WidgetPluginManager::$default should be removed.

Also, #1985344: Add a dedicated @FieldFormatter annotation also took care of removing FormatterFactory (adding the corresponding code in createInstance() override in FormatterPluginManager - see commitdiff).
Dunno the reasons why this was done in one go back then, but should we do the same here ?

dawehner’s picture

Status: Needs work » Needs review
FileSize
15.55 KB
23.62 KB

Thank you for the good review!

A bit shaky :-).
Maybe "Widgets handle how fields are displayed in edit forms" ?

The worse the original comment is, the better the suggestion will be.

s/formatter/widget/ :-)

I did not had copy and paste with that annotation!

I think there was some movement on that front while I was afk - where do we stand with those now, isn't that automatically added ?

This is added now named "provider" to the metadata, so we can clean stuff up. Sadly this makes the patch bigger.

yched’s picture

Status: Needs review » Reviewed & tested by the community

Looks good! Thanks!

yched’s picture

alexpott’s picture

Committed 4fc16f8 and pushed to 8.x. Thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed
yched’s picture

tim.plunkett’s picture

This actually meant WidgetFactory is never used, see #2052751: WidgetFactory is not used anywhere so it should be removed for the removal of it.

swentel’s picture

Title: Add a dedicated @FieldWidget annotation » [Follow up] Add a dedicated @FieldWidget annotation
Status: Fixed » Needs review
Issue tags: -Field API
FileSize
575 bytes

Forgot one 'formatter' leftover.

yched’s picture

Status: Needs review » Reviewed & tested by the community

Ah, indeed.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2035315-11.patch, failed testing.

yched’s picture

Status: Needs work » Needs review

No kidding ?

#11: 2035315-11.patch queued for re-testing.

yched’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 637e6fb and pushed to 8.x. Thanks!

yched’s picture

Title: [Follow up] Add a dedicated @FieldWidget annotation » Add a dedicated @FieldWidget annotation

resetting title

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.