Problem/Motivation
If a comment contains a forward slash, for example, in a path or URL, it will be stripped when displayed at update.php or using drush updb.
A comment like this (from media_library_post_update_default_administrative_list_to_table_display()):
/**
* Sets /admin/content/media to the table display of the 'media' view.
*/
Gets converted to this:
8705 - Sets admincontentmedia to the table display of the 'media' view.
The code doing this is this (line 339 of update.inc):
$description = str_replace(["\n", '*', '/'], '', $func->getDocComment());
This same code is also in UpdateRegistry.php, which affects how it's displayed when running drush updb.
Media Library Updates are missing some characters such as the forward slash for '/admin/content/media' when using update.php

Proposed resolution
Remove the single character replacements, which are too "greedy" or just ill-conceived and strip the start and end of the comment first, then any instance of "\n *" (i.e. a new line, a space and an asterisk, which happens on each new comment line).
- $description = str_replace(["\n", '*', '/'], '', $func->getDocComment());
+ $description = rtrim($func->getDocComment(), "\n */");
+ $description = ltrim($description, "/**\n * ");
+ $description = trim(str_replace("\n *", "", $description), ' ');
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | Screenshot 2026-06-16 at 00-24-09 Drupal database update dev2-web.png | 16.89 KB | quietone |
| #33 | 3087184-nr-bot.txt | 144 bytes | needs-review-queue-bot |
| #15 | 3087184-15.patch | 6.48 KB | oknate |
| #15 | 3087184-15--FAIL.patch | 4.72 KB | oknate |
| #15 | 3087184--interdiff-12-15.txt | 3.29 KB | oknate |
Comments
Comment #2
oknateSee media_library_post_update_default_administrative_list_to_table_display(). Maybe the URL needs quotes?
Comment #4
oknateComment #5
oknateComment #6
oknateComment #7
oknateComment #8
oknateThis is also an issue with
drush updb:Comment #9
oknateThis fixes it for
drush updbas well.Comment #10
oknateComment #12
oknateAdding test coverage for the update.php portion. I'm not sure how to test drush comment output yet.
Comment #14
oknateAdding test coverage for UpdateRegistry.php, which is what drush uses.
Comment #15
oknateThis should fix test failures.
Comment #16
oknateComment #17
oknateComment #18
oknateComment #19
oknateComment #24
oknateComment #26
effulgentsia commentedComment #33
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #36
quietone commentedThis has been fixed.