Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up to #2571949: Remove !placeholder in link module
Problem/Motivation
See #2566503: [meta] Replace remaining !placeholder for Non-URL HTML outputs only
modules/locale/locale.bulk.inc: $context['message'] = t('!message (@percent%).', array('!message' => $options['message'], '@percent' => (int) ($context['finished'] * 100)));
Proposed resolution
Remaining tasks
Agree that removing HTML support makes sense.
User interface changes
None
API changes
Date format strings no longer support adding HTML using the \ escape character.
Data model changes
None
Beta phase evaluation
Issue category | Bug because at the moment date formats support HTML but it is escaped |
---|---|
Issue priority | Major because part of the critical to remove !placeholder |
Disruption | Disruptive for existing sites that are adding HTML to date formats. If HTML is required in a formatted date then the site should implement a custom field formatter to do this. |
Comment | File | Size | Author |
---|---|---|---|
#3 | locale-placeholder-2571951-3.patch | 989 bytes | Sutharsan |
#3 | screenshot-2571951-3-2.png | 68.76 KB | Sutharsan |
#3 | screenshot-2571951-3-1.png | 110.36 KB | Sutharsan |
Comments
Comment #2
Sutharsan CreditAttribution: Sutharsan as a volunteer commentedWorking on it.
Comment #3
Sutharsan CreditAttribution: Sutharsan as a volunteer commentedThe message in
t('@message (@percent%).', ...)
comes fromlocale_translation_batch_fetch_import()
and is the return value oft()
.See attached screenshots that a custom translation with HTML is not escaped twice.
Comment #4
dawehnerIt is perfect to fix it, in an ideal world we would have a test coverage to ensure that autoescaping doesn't happen.
Comment #5
alexpottCommitted e34bb4a and pushed to 8.0.x. Thanks!
Comment #8
nevergone CreditAttribution: nevergone commentedAlready committed.
Fixed.