"None" option is not renamed to "Root directory" in Drupal 10

Created on 5 December 2023, 7 months ago
Updated 6 December 2023, 7 months ago

Problem/Motivation

The Media Directories module renames the "- None -" label when selecting a taxonomy term to "Root directory" in a hook_field_widget_WIDGET_TYPE_form_alter implementation. This no longer works in Drupal 10 - see https://www.drupal.org/node/3180429 β†’

Steps to reproduce

  1. Have the module enabled, and a media entity configured to use a media directories vocabulary
  2. Go to create a Media entity with directories enabled
  3. Expected: the default/none label in the "Directory" field to read "Root directory"
  4. Actual: the label reads "- None -" (the core default)

Proposed resolution

Amend media_directories_field_widget_options_select_form_alter() to implement hook_field_widget_complete_WIDGET_TYPE_form_alter instead, i.e. rename it to media_directories_field_widget_complete_options_select_form_alter() and update the function code accordingly.

Remaining tasks

Review & apply patch.

πŸ› Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom pfaocle North Wales

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024