Follow-up to #2559445: Replace !placeholder with @placeholder in aggregator module

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 Update 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 Update module.

core/modules/update/*

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

Comments

joelpittet created an issue. See original summary.

joelpittet’s picture

Status: Active » Needs review
StatusFileSize
new9.68 KB
mile23’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
$ git apply replace_placeholder-2559469-2.patch 
error: patch failed: core/modules/update/update.module:72
error: core/modules/update/update.module: patch does not apply
sharique’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new11.21 KB

Here is updated patch.

mile23’s picture

Status: Needs review » Reviewed & tested by the community

Looked for other !placeholders in strings using NetBeans and my eyes. (!? as a wildcard expression)

Couldn't find any.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/update/update.module
@@ -441,7 +441,7 @@ function update_fetch_data_finished($success, $results) {
-  $message['subject'] .= t('New release(s) available for !site_name', array('!site_name' => \Drupal::config('system.site')->get('name')), array('langcode' => $langcode));
+  $message['subject'] .= t('New release(s) available for @site_name', array('@site_name' => \Drupal::config('system.site')->get('name')), array('langcode' => $langcode));

@webchick has pointed that this is incorrect... It'll result in emails becoming

Welcome to Webchick"s Crazy Drupal Site

izus’s picture

Status: Needs work » Needs review
StatusFileSize
new2.18 KB

hi,
i configured my site name to "izus's website"
i applied the patch
i enabled update module and run cron
the $message['subject'] contains: New release(s) available for izus's website

with !site_name back again it's now: New release(s) available for izus's website

i also deleted the modifications in hook_help as there is already an issue for that #2560783: Replace !placeholder with :placeholder for URLs in hook_help() implementations

alexpott’s picture

+++ b/core/modules/update/update.module
@@ -451,10 +451,10 @@ function update_mail($key, &$message, $params) {
-    $message['body'][] = t('Your site is currently configured to send these emails when any updates are available. To get notified only for security updates, !url.', array('!url' => $settings_url));
+    $message['body'][] = t('Your site is currently configured to send these emails when any updates are available. To get notified only for security updates, @url.', array('@url' => $settings_url));
...
-    $message['body'][] = t('Your site is currently configured to send these emails only when security updates are available. To get notified for any available updates, !url.', array('!url' => $settings_url));
+    $message['body'][] = t('Your site is currently configured to send these emails only when security updates are available. To get notified for any available updates, @url.', array('@url' => $settings_url));

Not sure this one is correct either since it is an email.

alexpott’s picture

Status: Needs review » Needs work

Also #7 seems to be missing most of the "correct" changes from #4

izus’s picture

Status: Needs work » Needs review
StatusFileSize
new2.65 KB

Hi,
Thanks for the review, here is a new patch.

- it addresses #8 by puting back !url
- the #9 is due to deleting the modifications in hook_help as there is a special issue for those (mentionned in #7) #2560783: Replace !placeholder with :placeholder for URLs in hook_help() implementations

Thanks

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.

xjm’s picture