Problem/Motivation

This issue is a result of #2506445: Replace !placeholder with @placeholder in t() and format_string() for non-URLs in tests where we uncovered that ConfigImporter is more difficult than other instances of !placeholder which is well documented in #2514044: Do not use SafeMarkup::format in exceptions.

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

This issue addresses !placeholder in Config

File Scope is:

core/lib/Drupal/Core/Config/*
core/modules/config/*

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

Anonymous’s picture

Ryan Weal created an issue. See original summary.

pguillard’s picture

Assigned: Unassigned » pguillard
pguillard’s picture

Assigned: pguillard » Unassigned
Anonymous’s picture

This is probably no longer necessary, it looks like it has been successfully patched in the other issue.

joelpittet’s picture

Status: Active » Needs review
FileSize
2.74 KB

We started splitting the other issue so this is being re-purposed.

justAChris’s picture

Issue summary: View changes

Updated IS to include template from similar issue.

Some useful information related to ConfigImporter: #2506445-85: Replace !placeholder with @placeholder in t() and format_string() for non-URLs in tests

@joelpittet: can we include any related tests here?

core/modules/config/src/Tests/ConfigImporterTest.php
joelpittet’s picture

Ah probably why things break, thanks @justAChris

Added all config.

The last submitted patch, 5: replace_placeholder-2551743-5.patch, failed testing.

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

I tried testing all different scenarios where the escaping of placeholders inside messages have changed and there was no visual difference before/after. I didn't test the exception where SafeString object has been created because I didn't manage to throw an exception which would trigger that. Maybe @joelpittet has insight how to trigger that? Anyway otherwise the patch seems fine for me.

lauriii’s picture

Removed hook_help() from the patch

justAChris’s picture

Title: Replace !placeholder references in ConfigImporter with @placeholder » Replace !placeholder references in Config with @placeholder
Issue summary: View changes

In comment #7 we included all of config, simply updating file bounds in IS and issue title to comply.

justAChris’s picture

FileSize
203.33 KB

Regarding SafeString in #9, Looks good to me:
Config Import Unexpected exception

A bit of a pain to reproduce, I've outlined the steps at the bottom of #2506445-85: Replace !placeholder with @placeholder in t() and format_string() for non-URLs in tests, reran these steps with the patch in #10

The only thing I would consider on this patch is cleaning up the tests to remove unecessary functions from the asserts, but I think that's out of scope here.

RTBC++

catch’s picture

Status: Reviewed & tested by the community » Postponed
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
3.8 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.

Status: Needs review » Needs work

The last submitted patch, 15: replace_placeholder-2551743-15.patch, failed testing.

Status: Needs work » Needs review
Sutharsan’s picture

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