Skip to content
Snippets Groups Projects

Resolve #3418165 "Support emptyoption for"

4 unresolved threads

Closes #3418165

Merge request reports

Approval is optional

Merged by Bryan HeislerBryan Heisler 1 year ago (Feb 5, 2024 5:15pm UTC)

Merge details

  • Changes merged into 2.0.x with c667094d (commits were squashed).
  • Did not delete the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
24 24 /**
25 25 * {@inheritdoc}
26 26 */
27 public function viewElements(FieldItemListInterface $items, $langcode) {
27 public function viewElements(FieldItemListInterface $items, $langcode): array {
  • Adam Nagy
  • 23 23 */
    24 24 class TypedLinkWidget extends LinkWidget {
    25 25
    26 private $column;
    27 private $required;
    28 private $options;
    26 /**
    27 * Widget options.
    28 *
    29 * @var array
    30 */
    31 private array $options;
  • Adam Nagy
  • 28 *
    29 * @var array
    30 */
    31 private array $options;
    29 32
    30 33 /**
    31 * {@inheritdoc}
    34 * Get the column name of the field.
    35 *
    36 * @return string
    37 * The column name.
    32 38 */
    33 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings) {
    34 parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
    35 $this->column = $field_definition->getFieldStorageDefinition()->getMainPropertyName();
    39 private function getColumn(): string {
  • Adam Nagy
  • 51 51 $properties['link_type'] = DataDefinition::create('string')
    52 52 ->setLabel(t('Link Type'))
    53 53 ->addConstraint('Length', ['max' => 255])
    54 ->setRequired(TRUE);
    54 ->setRequired(FALSE);
    • If there would have been tests added, it would have shown that the form validation fails with "The value you selected is not a valid choice." and cannot be saved unless you select a value to this field.

      Edited by Adam Nagy
    • Please register or sign in to reply
  • These need to be sorted.

  • Please register or sign in to reply
    Loading