Problem/Motivation

In order to make #2506445: Replace !placeholder with @placeholder in t() and format_string() for non-URLs in tests approachable, we need to break it up into smaller chunks. This issue address !placeholder in the Contact module

See #2506427: [meta] !placeholder causes strings to be escaped and makes the sanitization API harder to understand for complete motivation on removal of !placeholder

Proposed resolution

Replace !placeholder with @placeholder in the Contact module.

File bounds:

core/modules/contact/*

Remaining tasks

  1. Replace !placeholder with @placeholder. Refer to patch in #2506445-85: Replace !placeholder with @placeholder in t() and format_string() for non-URLs in tests as that patch should have related update
  2. Ensure tests come back clean
  3. Manually test the update and post screen shot after patch, review source for any difference in escaping.

User interface changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

justAChris created an issue. See original summary.

justAChris’s picture

Title: Replace !placeholder with @placeholder in contact module » Replace !placeholder with @placeholder in Contact module
Component: base system » contact.module
Issue summary: View changes
geertvd’s picture

Status: Active » Needs review
FileSize
14.76 KB

For now, I just took that bit of the big one in #2506445: Replace !placeholder with @placeholder in t() and format_string() for non-URLs in tests, I think that replaces all of them. Will do a more detailed check if any become double escaped.

lauriii’s picture

Status: Needs review » Needs work
+++ b/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -21,17 +21,17 @@ function contact_help($route_name, RouteMatchInterface $route_match) {

@@ -21,17 +21,17 @@ function contact_help($route_name, RouteMatchInterface $route_match) {
       $contact_page = \Drupal::url('entity.contact_form.collection');
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Contact module allows visitors to contact registered users on your site, using the personal contact form, and also allows you to set up site-wide contact forms. For more information, see the <a href="!contact">online documentation for the Contact module</a>.', array('!contact' => 'https://www.drupal.org/documentation/modules/contact')) . '</p>';
+      $output .= '<p>' . t('The Contact module allows visitors to contact registered users on your site, using the personal contact form, and also allows you to set up site-wide contact forms. For more information, see the <a href="@contact">online documentation for the Contact module</a>.', array('@contact' => 'https://www.drupal.org/documentation/modules/contact')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';

There is one mega patch to fix the hook helps #2560783: Replace !placeholder with :placeholder for URLs in hook_help() implementations so it can be left out of this issue.

izus’s picture

Status: Needs work » Needs review
FileSize
7.62 KB

Here it is to respond to #5

justAChris’s picture

Status: Needs review » Postponed

Postponed on determining plan in parent #2506427: [meta] !placeholder causes strings to be escaped and makes the sanitization API harder to understand and then analyzing whether this issue still makes sense.

justAChris’s picture

Status: Postponed » Closed (duplicate)

Closing this, splitting by module was not the ideal approach to removing !placeholder. Marking as duplicate of #2506427: [meta] !placeholder causes strings to be escaped and makes the sanitization API harder to understand, since the chosen approach is / will be outlined there, please refer to it for any additional action.

Sutharsan’s picture

Status: Closed (duplicate) » Needs review
FileSize
7.62 KB

Rerolling patch for easy migration into single patch at #2506445: Replace !placeholder with @placeholder in t() and format_string() for non-URLs in tests.
Changing status for test bot. Do revert status after test.

Sutharsan’s picture

Status: Needs review » Closed (duplicate)
xjm’s picture