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 help text of all modules

Proposed resolution

Covers all the help text in hook_help() including a test that ensures there is no double escaping on any help text.

The issue will cause to translate all this help topics again for all languages

this would set back translators with 2.5%

see #16 & #28

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#84 2560783-83.patch314.34 KBstefan.r
#84 interdiff-80-83.txt12.41 KBstefan.r
#83 2560783-82.patch314.35 KBstefan.r
#83 interdiff-80-82.txt13.96 KBstefan.r
#80 interdiff.txt5.9 KBlauriii
#80 replace_placeholder-2560783-80.patch306.18 KBlauriii
#79 replace_placeholder-2560783-79.patch313.12 KBlauriii
#75 interdiff.txt3.05 KBstar-szr
#75 replace_placeholder-2560783-75.patch324.37 KBstar-szr
#71 replace_placeholder-2560783-71.patch321.31 KBstar-szr
#65 2560783-64.patch321.25 KBstefan.r
#62 interdiff.txt9.58 KBkgoel
#62 2560783-62.patch318.97 KBkgoel
#59 2560783-59.patch311.3 KBkgoel
#57 2560783-57.patch456.86 KBSutharsan
#57 interdiff-2560783-57-58.txt5.31 KBSutharsan
#56 changes.txt302.01 KBstefan.r
#56 2560783-56.patch313.73 KBstefan.r
#46 replace_placeholder-2560783-46.patch303.7 KBSutharsan
#26 2560783-italiano-search-help.jpg434.78 KBjustAChris
#21 replace_placeholder-2560783-21.patch300.63 KBjoelpittet
#21 interdiff.txt916 bytesjoelpittet
#14 replace_placeholder-2560783-4.patch300.62 KBlauriii
#8 replace_placeholder-2560783-8-fail.patch300.6 KBjoelpittet
#4 replace_placeholder-2560783-4.patch300.62 KBjoelpittet
#4 interdiff.txt2.85 KBjoelpittet
#3 Screen Shot 2015-09-01 at 08.56.12.png67.75 KBlauriii
#2 replace_placeholder-2560783-2.patch300.51 KBjoelpittet
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelpittet created an issue. See original summary.

joelpittet’s picture

lauriii’s picture

Issue summary: View changes
Status: Needs review » Needs work
FileSize
67.75 KB

I enabled all the core modules and clicked through all the help pages (:D) and I found out that contextual Links help page has some markup escaped:

I didn't still review the actual patch for simple human errors. Will do that later on :)

joelpittet’s picture

Thanks didn't check to see if there were normal escaped < characters.

Added to this patch and fixed that image.

joelpittet’s picture

Status: Needs work » Needs review
lauriii’s picture

Status: Needs review » Needs work
+++ b/core/modules/contextual/contextual.module
@@ -83,8 +83,7 @@ function contextual_help($route_name, RouteMatchInterface $route_match) {
+      $output .= '<li>' . t('Hovering over the area of interest will temporarily make the contextual links button visible (which looks like a pencil in most themes, and is normally displayed in the upper right corner of the area). The icon typically looks like this: <img src="@picture_url" alt="contextual links button" />', array('@picture_url' => file_create_url('core/misc/icons/bebebe/pencil.svg'))) . '</li>';

Now the translation string includes the img element. I think we need to still pass it as a variable.

joelpittet’s picture

Why does it need that? If I do that I'd have to use SafeString::create or render a img array to do that. This approach gives the alt context to the translator.

I'm no translation expert but was thinking this approach was better but could be wrong.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
300.6 KB

Here is the same patch without the fix to show that the test picks that up.

jhodgdon’s picture

Can I make a suggestion? Maybe in this issue you can just do all the straightforward cases where all you did is replace a !url with a @url in a hook_help(). Then do the other changes module by module so they can get more scrutiny. This patch is fairly large so it would be easier to review/commit if there was nothing controversial in it.

penyaskito’s picture

@lauriii: I would say #7 is correct, see https://www.drupal.org/node/322774

joelpittet’s picture

@jhodgdon I noticed that while doing the other ones the review was very straight forward for hook_help() to the point where it should be done be robots not people and it was easy enough to do an automated test with the existing test. Even if I had to write a new test it would have been easier.

I'd rather take a big chunk of exactly the same pattern repeated and remove it from our painstaking review (so we can concentrate on the harder parts of the review).

The only "controversial" part in this patch is my fix to the bug that was found in how to place an image tag into t().

joelpittet’s picture

Thanks for the documentation backup on that change @penyaskito. @lauriii do you agree or is there another issue with the approach I took there we aren't seeing?

Status: Needs review » Needs work

The last submitted patch, 8: replace_placeholder-2560783-8-fail.patch, failed testing.

lauriii’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
300.62 KB

I'm fine by the current solution :) I questioned it more because I didn't know which is correct! And thanks @penyaskito for your opinion.

Reuploading last passed patch because the test bot will automatically queue it to be tested later :)

alexpott’s picture

Thanks you --color-words. This looks good to go.

diff --git a/core/modules/help/src/Tests/HelpTest.php b/core/modules/help/src/Tests/HelpTest.php
index d7ddab2..3c7db11 100644
--- a/core/modules/help/src/Tests/HelpTest.php
+++ b/core/modules/help/src/Tests/HelpTest.php
@@ -113,10 +113,10 @@ protected function verifyHelp($response = 200) {
         foreach ($admin_tasks as $task) {
           $this->assertLink($task['title']);
         }
-        // Ensure there are no double escaped '& or '< characters.
+        // Ensure there are no double escaped '&' or '<' characters.
         $this->assertNoEscaped('&amp;');
         $this->assertNoEscaped('&lt;');
-        // Ensure there are no  escaped '< characters.
+        // Ensure there are no escaped '<' characters.
         $this->assertNoEscaped('<');
       }
     }

The comment needs a fix up.

So the one question I have is with the new issue to admin filter. Is this really worth the disruption to translations?

Gábor Hojtsy’s picture

Yeah each string modified here will appear as a new string to translate on localize.drupal.org. Each line is about one string change here AFAIS, so it would be over 200 strings for translators to translate again. Given Drupal 8 has about 8.2k strings (see https://localize.drupal.org/translate/projects/drupal/releases), this would set back translators with 2.5%. Its a sad technology fact that there is no translation memory and similar string suggestions on localize.drupal.org but at the same time, this change looks cosmetic given the ultimate filtering happening later on anyway, right?

andypost’s picture

Great point Gabor!
I see no any reason to escape this internal links and affect tremendous amount of strings to re-translate

PS: is there issue to follow in l10n_server like #587666: Add simple automated translation formatting checks

lauriii’s picture

The reason itself is not that there is existing security problems but instead the fact that ! filter will be deprecated. It also shows bad example for people which by copying the code might cause security problems to themselves.

jhodgdon’s picture

Status: Reviewed & tested by the community » Needs work

Looks like this is Needs Work for the comment problem in #15.

Gábor Hojtsy’s picture

If we want to set an example and accept that over 200 strings will need to be translated again from scratch, we at least better do it sooner than later to give more lead-time to translators.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
916 bytes
300.63 KB

@Gábor Hojtsy the parent change does another 200K of the same type of changes. This just does a bunch all at once.

hope not to put a halt on the whole operation, but if I can help en-mass convert them for the existing translations point me at an issue and I'll do my best to do so.

Gábor Hojtsy’s picture

Right, if we decide to do these, then it would also be useful to do them at once, not one in one beta and another in another (or in a/the RC). That would make the translator burden even bigger redoing and redoing things.

jhodgdon’s picture

Is it possible to do a copy/replace on the translations somehow on Localize? I have no idea where they are actually stored.

joelpittet’s picture

Creative drush sar even? https://www.drupal.org/project/sar

Gábor Hojtsy’s picture

Localize.drupal.org takes each d.o packaged release and finds all the strings in it. If a string is different even in one character, it will be a different string. I am not sure what kind of automated tool would you envision, but its possible to take the .po files for the latest Drupal 8 beta, find the strings which were changed in this patch in there and modify their source / translations to have the new placeholders. Once this patch lands, upload that to localize.drupal.org as suggestions. For that one needs to do this for all languages which requires joining all the translation teams as well. Not impossible to do but not an hour's work I think :)

justAChris’s picture

Pardon my ignorance here, but have the help texts addressed in the above patch actually been translated yet?

I downloaded a sample .po file (Italiano) to look for the some of the strings this patch is updating. Though I didn't try all of them, I was unsuccessful in finding any in the translation file.

Then tried on a install in Italiano via simplytest.me, trying the search help page:
Italiano search help translation
Clicked around in the help section with similar results. I can't speak for all languages and all help texts, but do we know if these help text strings have been translated for any language?

joelpittet’s picture

@Gábor Hojtsy I was thinking maybe fuzz the comparison operation to treat placeholder type changes as the same string if possible, even better would be strip the place holders out of the string before the comparison operation. That way renaming placeholders wouldn't break existing translations either.

Gábor Hojtsy’s picture

@justAChris: Drupal 8 is about 56% translated to Italian so I would not be surprised if spot-checking these strings did not result in translations. See https://localize.drupal.org/translate/drupal8, Ukrainian, Spanish, Danish, Hungarian and Finnish lead the way.

@joelpittet: right, so localize.drupal.org has 590k source strings. For each incoming new string to fuzzy match it against the existing strings sounds like a performance concern. Here is the Drupal 7 alpha1 announcement from 5.5 years ago where we explained around it too: https://localize.drupal.org/node/712. Here is an 8 year old issue that was marked as duplicate of a 5 year old issue: #194141: Implement msgmerge type fuzzy matching :) Contributors welcome :)

joelpittet’s picture

@Gábor Hojtsy thanks for the issue dig-up. If performance is a concern there may be some possible solutions there if they arise, I'll move that discussion over there.

Is this issue blocked on finding a solution or can we proceed @Gábor Hojtsy?

andypost’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

Let's stop here

Gábor Hojtsy’s picture

Status: Closed (won't fix) » Needs review

@andypost: is not a release manager or committer last I heard :)

@joelpittet: we don't have an automated way to tell the extent of the rework that translators will face, the spot-check with Italian was not very indicative as explained above. so I would not say this is blocked, it requires an executive decision weighting the benefits vs. (the hard to estimate) cost. 18 languages are more than 50% done with Drupal 8's translation that is at least 4k strings. There is no easy way to tell the overlap of those vs. these strings, unless someone has these strings in a .po file form and want to cross-merge with all the .po files from those 18 or so groups.

justAChris’s picture

Yes, spot checking in Italian was a bad example, thanks for that completion % link. Ukrainian looks to be entirely translated on the strings touched in the patch. Trying to get a concrete number though (without counting by hand).

xjm’s picture

Tagging explicitly.

I think we could not make this change after RC. Strings are not supposed to be frozen yet, but I can also see how this would be disruptive now nonetheless (for hook_help() in particular).

However, I think we could consider a script that runs a regex and updates the translations for !placeholder to be equivalent to @placeholder as a one-off (not as an ongoing thing, because it could actually impact translations in other cases).

xjm’s picture

FWIW, this is not merely a "cosmetic" change; @ vs. ! has very real consequences in terms of the safeness of URLs etc. even with XSS filtering.

Gábor Hojtsy’s picture

@xjm: so you are saying the help text is not admin XSS filtered later on?

jhodgdon’s picture

@Gabor - once you pass something through t() it is considered filtered/safe, and the render system no longer escapes or filters it.

justAChris’s picture

To help with the scope of this, got a quick script together to check the strings being touched in the patch against the translation files. Probably not 100% accurate, but here's the summary of the top few languages (ordered per https://localize.drupal.org/translate/drupal8)

Ukrainian: 207 Strings213 Strings
Spanish: 122 Strings
Danish: 36 Strings
Hungarian: 62 Strings 65 Strings
Finnish: 13 Strings
Dutch: 16 Strings
French: 1 String
Swedish: 23 Strings
Russian: 0 Strings

Obviously, more strings are going to be found in the rest of the languages (3 in Italian)

I've uploaded the scripts here:
https://github.com/justAChris/DrupalPlaceholderTranslations
The first script (stripHelpPatch.sh) only needs to be run if the patch changes. I've included the output of that script there (helpPatchStrip.txt), which uses the patch from #21

Gábor Hojtsy’s picture

@justAChris: amazing, thanks for quantifying the side effects of this patch. I think if similar scripts can be used to help at least the top of these teams adapt, then we should be able to get this land without much disruption. Such a script would need to replace the placeholder marker and generate a .po file with those strings only to be uploaded as suggestions once a beta/rc release with these strings is out. Looks like the big ones affected are Ukrainian, Spanish, Danish and Hungarian.

Back to RTBC as per #14 then. It would be **very important** to commit coordinated changes to these strings within the same development period, so we don't have a set of changes for the upcoming beta and then again a new set of changes to the same strings again for another beta, etc.

justAChris’s picture

Saw some oddities in the search string text file created, so cleaned those and slightly revised the above totals and added a few languages.

For the subsequent translation cleanup, noticed this is one instance where we aren't simply replacing ! with @, not sure if there are others.

+++ b/core/modules/contextual/contextual.module
@@ -76,16 +76,15 @@ function contextual_help($route_name, RouteMatchInterface $route_match) {
-      $sample_picture = '<img src="' . file_create_url('core/misc/icons/bebebe/pencil.svg') . '" alt="' . t('contextual links button') . '" />';
-      $output .= '<li>' . t('Hovering over the area of interest will temporarily make the contextual links button visible (which looks like a pencil in most themes, and is normally displayed in the upper right corner of the area). The icon typically looks like this: !picture', array('!picture' => $sample_picture)) . '</li>';
+      $output .= '<li>' . t('Hovering over the area of interest will temporarily make the contextual links button visible (which looks like a pencil in most themes, and is normally displayed in the upper right corner of the area). The icon typically looks like this: <img src="@picture_url" alt="contextual links button" />', array('@picture_url' => file_create_url('core/misc/icons/bebebe/pencil.svg'))) . '</li>';
joelpittet’s picture

@justAChris yeah that one is just going to have to break translation as it would normally. That is the proper way to do it as per the docs AFAICT.

Gábor Hojtsy’s picture

Yeah we don't need to cover every single case in the update automation, just trying to manage the scale of the changes.

justAChris’s picture

So, not to complicate things further, but bring awareness to the table, this hook_help() patch was broken apart from a larger patch in #2506445-96: Replace !placeholder with @placeholder in t() and format_string() for non-URLs in tests,97. Unfortunately, the parts of the original patch not in hook_help() also contain strings that are translated and have !placeholder being replaced similar to this patch.
I know @Gábor Hojtsy indicated we want to update the translations all at once if we go ahead with this, which makes a lot of sense. Having these separated out into different issues may make that difficult.

I've worked with my initial scripts to try to get an indication of the overall effect of the larger patch that replaces most occurrences of !placeholder throughout. It looks like the 213 Strings for Ukrainian becomes around 287 strings.
Though, I'm less confident with the accuracy of this number because the original patch is harder to parse.

Gábor Hojtsy’s picture

@justAChris: localize.drupal.org does not parse dev releases exactly because the changing nature of strings; so the important part would be to make these changes between two tagged releases "at once" not between one tagged release and another and then another, etc.

jhodgdon’s picture

Regarding the impact etc... Maybe we could separate the parent issue into:

a) Simple search-and-replace part
b) More complicated parts

Make sure to do (a), which I think is the bulk of the patches, all at once. This patch would be easy to review and easy to script on localize (I guess?). (b) would be a smaller number of strings and could be broken up into a few issues if needed.

justAChris’s picture

Status: Needs review » Postponed

This is postponed on #2558791: "!"-prefixed tokens should Xss::filterAdmin() but not affect safeness. Most of !placeholder in this patch occurs inside of <a href=. which may stay depending on the outcome of that issue.

Sutharsan’s picture

Status: Postponed » Needs review
FileSize
303.7 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. Revert status after test.

Sutharsan’s picture

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

Status: Closed (duplicate) » Postponed

Let's keep this at postponed until we determine if !placeholder in URLs will be changed to a different placeholder. Suggesting that this could become "Replace !placeholder in URLs for hook_help() text" or similar if the placeholders need replacement.

chx’s picture

Curious why this would set back translators 2-2.5%. Aren't these strings held in the localize.drupal.org database? If so, can we write some fancy SQL queries? If you need help with them, I can give ideas :)

dawehner’s picture

Curious why this would set back translators 2-2.5%. Aren't these strings held in the localize.drupal.org database? If so, can we write some fancy SQL queries? If you need help with them, I can give ideas :)

Yeah for sure, we discussed that. We then also discussed about adding a custom hook_update_N()/hook_post_update_NAME() to deal with that for each individual site.
See some of the discussion on #2506427: [meta] !placeholder causes strings to be escaped and makes the sanitization API harder to understand

Gábor Hojtsy’s picture

Fancy SQL queries are possible, as discussed above. We would need to keep the translations for pre this change in prior betas, because those of course used the old string (and have their review/submission history tied to that). SQL is possible to copy over some or all of that history or copy over values with a preset user or somesuch. Either way its more work to do than this patch alone, which is what's important to recognize and factor in.

justAChris’s picture

Note that the following has been placed in a separate issue #2568257: Add double escape test for hook_help(). Not necessary to update current patch here yet, still postponed.

+++ b/core/modules/help/help.module
@@ -113,6 +113,11 @@ protected function verifyHelp($response = 200) {
         foreach ($admin_tasks as $task) {
           $this->assertLink($task['title']);
         }
+        // Ensure there are no double escaped '&' or '<' characters.
+        $this->assertNoEscaped('&amp;');
+        $this->assertNoEscaped('&lt;');
+        // Ensure there are no escaped '<' characters.
+        $this->assertNoEscaped('<');
       }
effulgentsia’s picture

Title: Replace !placeholder with @placeholder in hook_help() text » Replace !placeholder with :placeholder in hook_help() text
Priority: Major » Critical
Issue tags: -Needs release manager review

See issue summary of #2506427: [meta] !placeholder causes strings to be escaped and makes the sanitization API harder to understand for details as to the title and priority change. Still postponed on #2565895: Add a new :placeholder to SafeMarkup::format() for URLs that handles bad protocols, unless someone want to roll a patch in the meantime that also includes that one until that one lands.

effulgentsia’s picture

Title: Replace !placeholder with :placeholder in hook_help() text » Replace !placeholder with :placeholder in href values of hook_help() text
effulgentsia’s picture

Title: Replace !placeholder with :placeholder in href values of hook_help() text » Replace !placeholder with :placeholder for URLs in hook_help() implementations

Sorry for the noise, but trying to clarify the title more.

stefan.r’s picture

Status: Postponed » Needs review
FileSize
313.73 KB
302.01 KB

posting a combined patch with #2565895-92: Add a new :placeholder to SafeMarkup::format() for URLs that handles bad protocols.

Did two simple search & replace in the previous patch and manually reviewed that we weren't changing any non-URL @placeholders.

Sutharsan’s picture

Found a few more hook_help strings.

kgoel’s picture

I am reviewing patch#57

I was going to review patch #57 but patch in #57 has some of the files that shouldn't be in this patch for example composer.json file. Reviewing #56 patch now.

kgoel’s picture

Patch in #56 didn't apply. Re-rolled

Status: Needs review » Needs work

The last submitted patch, 59: 2560783-59.patch, failed testing.

The last submitted patch, 59: 2560783-59.patch, failed testing.

kgoel’s picture

Status: Needs work » Needs review
FileSize
318.97 KB
9.58 KB

Applied change from #57. Found some instances of "!placeholder" and replaced with ":placeholder".

Status: Needs review » Needs work

The last submitted patch, 62: 2560783-62.patch, failed testing.

The last submitted patch, 62: 2560783-62.patch, failed testing.

stefan.r’s picture

Status: Needs work » Needs review
FileSize
321.25 KB

reroll of just the changes in #56 with all the consecutive interdiffs (in case that's what the test fails were about)

dawehner’s picture

It is really helpful to be able to use git diff --word-diff

So for static strings I think we wanna use :placeholder but we just need to be aware of it.

stefan.r’s picture

So for static strings I think we wanna use :placeholder but we just need to be aware of it.

@dawehner what do you mean here?

Also discussed with @kgoel how we don't technically /need/ to use <a href=":cron">:cron</a> as @cron might be fine outside the attribute, but this seems fine to me anyway.

justAChris’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Regarding #66, I think @dawehner is referencing the following:

+++ b/core/modules/menu_link_content/menu_link_content.module
@@ -18,10 +18,10 @@ function menu_link_content_help($route_name, RouteMatchInterface $route_match) {
-        $output .= ' ' . t('For more information, see the <a href="!drupal-org-help">online documentation for the Custom Menu Links module</a>. If you enable the Menu UI module, it provides an interface for managing menus and menu links.', array('!drupal-org-help' => 'https://www.drupal.org/documentation/modules/menu_link'));
+        $output .= ' ' . t('For more information, see the <a href=":drupal-org-help">online documentation for the Custom Menu Links module</a>. If you enable the Menu UI module, it provides an interface for managing menus and menu links.', array(':drupal-org-help' => 'https://www.drupal.org/documentation/modules/menu_link'));

We could remove the placeholder completely, but if we did, it would be more difficult to review and also would have a larger impact on translated strings.

Patch needs reroll now that #2568257: Add double escape test for hook_help() is in.

dawehner’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

Also discussed with @kgoel how we don't technically /need/ to use :cron as @cron might be fine outside the attribute, but this seems fine to me anyway.

Yeah its pretty much this question. There are also examples of like "https://www.drupal.org/node/1" in there. Totally out of scope, but I really wonder why its then not just hardcoded.

Went through all the hook_help() implementations. There is one conversion left in contextual_help().

dawehner’s picture

double post

star-szr’s picture

Easy reroll:

Using index info to reconstruct a base tree...
M       core/modules/content_translation/content_translation.module
M       core/modules/help/src/Tests/HelpTest.php
Falling back to patching base and 3-way merge...
Auto-merging core/modules/help/src/Tests/HelpTest.php

Status: Needs review » Needs work

The last submitted patch, 71: replace_placeholder-2560783-71.patch, failed testing.

The last submitted patch, 71: replace_placeholder-2560783-71.patch, failed testing.

The last submitted patch, 71: replace_placeholder-2560783-71.patch, failed testing.

star-szr’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
324.37 KB
3.05 KB

I took a quick look over the changes that are not from #2565895: Add a new :placeholder to SafeMarkup::format() for URLs that handles bad protocols and didn't find anything out of place. I used git diff -U0 --color-words.

Here are the changes for contextual.module.

Status: Needs review » Needs work

The last submitted patch, 75: replace_placeholder-2560783-75.patch, failed testing.

star-szr’s picture

Just to back up what @dawehner said in #69 I also reviewed all hook_help() implementations and didn't find any implementations with ! placeholders not covered in this patch.

  1. +++ b/core/modules/responsive_image/src/ResponsiveImageStyleForm.php
    @@ -118,7 +118,7 @@ public function form(array $form, FormStateInterface $form_state) {
             if (\Drupal::moduleHandler()->moduleExists('help')) {
    -          $description = $this->t('See the <a href="!responsive_image_help">Responsive Image help page</a> for information on the sizes attribute.', array('!responsive_image_help' => (\Drupal::url('help.page', array('name' => 'responsive_image')))));
    +          $description = $this->t('See the <a href=":responsive_image_help">Responsive Image help page</a> for information on the sizes attribute.', array(':responsive_image_help' => (\Drupal::url('help.page', array('name' => 'responsive_image')))));
             }
    

    Strictly speaking this isn't a hook_help() implementation unless I'm missing something. Maybe out of scope?

  2. +++ b/core/modules/system/src/Form/CronForm.php
    @@ -107,7 +107,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    -      '#markup' => '<p>' . t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => $this->url('system.cron', array('key' => $this->state->get('system.cron_key')), array('absolute' => TRUE)))) . '</p>',
    +      '#markup' => '<p>' . t('To run cron from outside the site, go to <a href=":cron">:cron</a>', array(':cron' => $this->url('system.cron', array('key' => $this->state->get('system.cron_key')), array('absolute' => TRUE)))) . '</p>',
    
    +++ b/core/modules/system/src/Form/PerformanceForm.php
    @@ -141,7 +141,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    -      $disabled_message = ' ' . t('<strong class="error">Set up the <a href="!file-system">public files directory</a> to make these optimizations available.</strong>', array('!file-system' => $this->url('system.file_system_settings')));
    +      $disabled_message = ' ' . t('<strong class="error">Set up the <a href=":file-system">public files directory</a> to make these optimizations available.</strong>', array(':file-system' => $this->url('system.file_system_settings')));
    

    These changes definitely seem out of scope for this issue.

Not sure if these points have been discussed but it seems like they haven't been. I'm under the assumption that other than tests this should only be changing .module files.

lauriii’s picture

Assigned: Unassigned » lauriii
lauriii’s picture

Status: Needs work » Needs review
FileSize
313.12 KB

Just a plain reroll

lauriii’s picture

Assigned: lauriii » Unassigned
FileSize
306.18 KB
5.9 KB

Removed changes out of the scope of this issue

The last submitted patch, 79: replace_placeholder-2560783-79.patch, failed testing.

The last submitted patch, 75: replace_placeholder-2560783-75.patch, failed testing.

stefan.r’s picture

FileSize
13.96 KB
314.35 KB

This one was interesting to review, even with --color-words :)

Seems we have them all now?

stefan.r’s picture

FileSize
12.41 KB
314.34 KB

The last submitted patch, 83: 2560783-82.patch, failed testing.

googletorp’s picture

Status: Needs review » Reviewed & tested by the community

I made a manual review of all hook_help in Drupal core with the patch applied (It got a bit rough after a while so might have missed something). Anyways it all looks good, couldn't find a single used of !

On a side note. I noticed that wikipedia links are placed inside the t string (I guess the reason of this is to make the link translatable), but we don't do that with links for php.net which is also localized. Shouldn't we do that for these links as well? We could do this in a followup, since it's not really related to this issue.

dawehner’s picture

On a side note. I noticed that wikipedia links are placed inside the t string (I guess the reason of this is to make the link translatable), but we don't do that with links for php.net which is also localized. Shouldn't we do that for these links as well? We could do this in a followup, since it's not really related to this issue.

That sounds something indeed great to discuss on a follow up: #2571845: Links to wikipedia/php.net should be part of the actual t() string so they can be localized

  • alexpott committed 7a25f51 on 8.0.x
    Issue #2560783 by stefan.r, joelpittet, lauriii, Cottser, Sutharsan,...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 7a25f51 and pushed to 8.0.x. Thanks!

ifrik’s picture

The Help text standard page on drupal.org needs to be updated accordingly as well now, so that future module hook_help texts are written correctly.

justAChris’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

The last submitted patch, 79: replace_placeholder-2560783-79.patch, failed testing.