Problem/Motivation

The "Add media" button for the Media Library is too general IMO.

Instead, I propose that the label is "Add @label", with @label being the field label.

A couple of examples:

Documents (field_documents)

"Add media" becomes "Add Documents"

Image (field_image

"Add media" becomes "Add Image"

----

It'll also encourage well-named field labels for media fields.

Patch attached.

Comments

ras-ben created an issue. See original summary.

ras-ben’s picture

StatusFileSize
new1.12 KB
ras-ben’s picture

Also including a 9.3 patch.

The last submitted patch, 2: 3269308-media_library_better_add_label.patch, failed testing. View results

gauravvvv’s picture

StatusFileSize
new1.11 KB
new725 bytes

Re-rolled patch #3, Fixed custom command failed.

Status: Needs review » Needs work

The last submitted patch, 5: 3269308-5.patch, failed testing. View results

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

rassoni’s picture

Status: Needs work » Needs review
StatusFileSize
new1.14 KB
new1.13 KB

Re-rolled patch #5, Fixed failed the test.

Status: Needs review » Needs work

The last submitted patch, 8: 3269308-8.patch, failed testing. View results

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.