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.
Problem/Motivation
See #2566503: [meta] Replace remaining !placeholder for Non-URL HTML outputs only
lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php: $summary[] = t('Textfield size: !size', array('!size' => $this->getSetting('size')));
lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php: $form_state->setError($element, t('!name field is required.', array('!name' => $element['#title'])));
lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php: $summary[] = t('Number of rows: !rows', array('!rows' => $this->getSetting('rows')));
lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php: $summary[] = t('Textfield size: !size', array('!size' => $this->getSetting('size')));
lib/Drupal/Core/Field/Plugin/Field/FieldWidget/UriWidget.php: $summary[] = $this->t('URI field size: !size', array('!size' => $this->getSetting('size')));
Proposed resolution
The one remaining question is do translators have a need to add HTML to a date format string?
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 |
---|---|---|---|
#4 | 2571915.patch | 4.44 KB | amateescu |
Comments
Comment #2
dawehnerComment #3
dawehnerLol no
Comment #4
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedHere we go.
Comment #5
dawehner#title could be a render array at that point. Let's use the render() function for that
Comment #6
pwolanin CreditAttribution: pwolanin as a volunteer and at Acquia commentedI disagree - supporting render arrays is out of scope for a ! to @ conversion
Comment #7
pwolanin CreditAttribution: pwolanin as a volunteer and at Acquia commentedComment #8
pwolanin CreditAttribution: pwolanin as a volunteer and at Acquia commentedLooks like a simple 1:1 conversion.
Comment #9
alexpottCommitted a6b4ec0 and pushed to 8.0.x. Thanks!
Comment #11
alexpottI agree with @pwolanin that dealing with a markup array is out of scope.
Comment #13
stefan.r CreditAttribution: stefan.r commented