Skip to content
Snippets Groups Projects

FieldWidget attribute

Closed Michael Strelan requested to merge issue/drupal-3420978:3420978-field-widget into 11.x
1 unresolved thread

Closes #3420978

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 <?php
2
3 namespace Drupal\Core\Field\Attribute;
4
5 use Drupal\Component\Plugin\Attribute\Plugin;
6 use Drupal\Core\StringTranslation\TranslatableMarkup;
7
8 /**
9 * Defines a FieldWidget attribute for plugin discovery.
10 *
11 * Plugin Namespace: Plugin\Field\FieldWidget
12 *
13 * Widgets handle how fields are displayed in edit forms.
14 *
15 * Additional annotation keys for widgets can be defined in
16 * hook_field_widget_info_alter().
  • Comment on lines +15 to +16

    Not sure how to handle this.

  • Additional annotation keys

  • Had a look in core, there are 3 modules that implement hook_field_widget_info_alter, all of them just add to the field_types key. We also have coverage for this in WidgetPluginManagerTest. I also looked in contrib and there are hundreds of modules implementing this hook, but the ones I looked at all just add to field_types. Regardless, since the attribute gets converted to an array, I don't think we're breaking anything here. It's mostly just the wording "annotation keys" that's bothering me.

  • Please register or sign in to reply
  • Michael Strelan
  • Michael Strelan added 4 commits

    added 4 commits

    Compare with previous version

  • Michael Strelan added 1 commit

    added 1 commit

    Compare with previous version

  • Michael Strelan added 2 commits

    added 2 commits

    Compare with previous version

  • Michael Strelan marked this merge request as ready

    marked this merge request as ready

  • Michael Strelan added 1 commit

    added 1 commit

    Compare with previous version

  • Michael Strelan added 1 commit

    added 1 commit

    • 6660645c - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Michael Strelan added 1 commit

    added 1 commit

    • 99897123 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Michael Strelan added 1 commit

    added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading