There are a couple of places in core where you see this kind of thing. This is from modules/file/file.install:

    $description = t('Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the <a href="http://pecl.php.net/package/uploadprogress">PECL uploadprogress library</a> (preferred) or to install <a href="http://us2.php.net/apc">APC</a>.');

Normally, we would escape out the URL, as in this example from openid.install:

        'description' => t('OpenID suggests the use of the GMP Math library for PHP for optimal performance. Check the <a href="@url">GMP Math Library documentation</a> for installation instructions.', array('@url' => 'http://www.php.net/manual/book.gmp.php')),
 

The first example should be changed to be like the second example. I'm not sure if tehre are other examples besides two next to each other in file.install, but it would be worth checking.

Note that this patch will conflict with #692366: Stop forcing language/mirror for PHP manual links, which is changing the URLs to be language-independent.

And probably this cannot be backported to Drupal 7 at this point.

Comments

BassistJimmyJam’s picture

Status: Active » Needs review
StatusFileSize
new9.62 KB
jhodgdon’s picture

Status: Needs review » Needs work

Thanks! The patch is mostly correct, but I found two problems:

a)

-      $description = t('Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the <a href="http://pecl.php.net/package/uploadprogress">PECL uploadprogress library</a> (preferred) or to install <a href="http://us2.php.net/apc">APC</a>.');
+      $description = t('Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the <a href="@uploadprogress_url">PECL uploadprogress library</a> (preferred) or to install <a href="@apc_url">APC</a>.', array('uploadprogress_url' => 'http://pecl.php.net/package/uploadprogress', '@apc_url' => 'http://us2.php.net/apc'));

uploadprogress_url is missing @ in the replace array.

b)

-      $output .= '<dd>' . t('By default, the Search module only supports exact keyword matching in content searches. You can modify this behavior by installing a language-specific stemming module for your language (such as <a href="http://drupal.org/project/porterstemmer">Porter Stemmer</a> for American English), which allows words such as walk, walking, and walked to be matched in the Search module. Another approach is to use a third-party search technology with stemming or partial word matching features built in, such as <a href="http://drupal.org/project/apachesolr">Apache Solr</a> or <a href="http://drupal.org/project/sphinx">Sphinx</a>. These and other <a href="@contrib-search">search-related contributed modules</a> can be downloaded by visiting Drupal.org.', array('@contrib-search' => 'http://drupal.org/project/modules?filters=tid%3A105')) . '</dd>';
+      $output .= '<dd>' . t('By default, the Search module only supports exact keyword matching in content searches. You can modify this behavior by installing a language-specific stemming module for your language (such as <a href="@porterstemmer_url">Porter Stemmer</a> for American English), which allows words such as walk, walking, and walked to be matched in the Search module. Another approach is to use a third-party search technology with stemming or partial word matching features built in, such as <a href="@solr_url">Apache Solr</a> or <a href="@sphink_url">Sphinx</a>. These and other <a href="@contrib-search">search-related contributed modules</a> can be downloaded by visiting Drupal.org.', array('@contrib-search' => 'http://drupal.org/project/modules?filters=tid%3A105', '@porterstemmer_url' => 'http://drupal.org/project/porterstemmer', '@solr_url' => 'http://drupal.org/project/apachesolr', '@sphinx_url' => 'http://drupal.org/project/sphinx')) . '</dd>';

@sphinx_url is misspelled as @sphnik_url in the t() text.

BassistJimmyJam’s picture

Status: Needs work » Needs review
StatusFileSize
new9.62 KB

Addressed comments in #2.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks good then, thanks!

jhodgdon’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: -Novice

Actually, since the tests passed even with the errors I found in #2, I think this either needs some automated tests or some manual testing before we can say for sure that it's OK.

jhodgdon’s picture

Issue tags: +Needs manual testing

I think I had the wrong testing tag

Dan Silver’s picture

Hey,
I'm trying to manually test the patch, but git is saying 'fatal: corrupt patch at line 83'. I'm probably doing something wrong!
My steps:

  1. Installed the latest 8.x dev branch using Acquia Dev Desktop
  2. Downloaded the patch to my Drupal installation
  3. Using git, I changed the path to my Drupal directory
  4. I then ran the command 'git apply translated-urls-1471848-3.patch'
  5. Then I got the error 'fatal:corrupt patch at line 83'
jhodgdon’s picture

#3: translated-urls-1471848-3.patch queued for re-testing.

jhodgdon’s picture

Hmmm. Dan Silver: I just hit Retest to see if the test bot has the same problem. You might want to try downloading the patch again, just to make sure...

Status: Needs review » Needs work

The last submitted patch, translated-urls-1471848-3.patch, failed testing.

jhodgdon’s picture

Issue tags: +Novice

OK, looks like the patch above needs a reroll.

Dan Silver’s picture

Assigned: Unassigned » Dan Silver

This should be within my skill range. I'll give it a try!

BassistJimmyJam’s picture

Status: Needs work » Needs review
StatusFileSize
new9.6 KB

Rerolled.

Status: Needs review » Needs work

The last submitted patch, translated-urls-1471848-12.patch, failed testing.

BassistJimmyJam’s picture

Status: Needs work » Needs review
StatusFileSize
new9.6 KB

Hmm... missed a closing parenthesis.

Dan Silver’s picture

Assigned: Dan Silver » Unassigned
jhodgdon’s picture

Hey BassistJimmyJam -- Thanks for the patch reroll!

But ... Dan Silver had assigned the issue to himself that same day. Next time, it would be more polite to find an issue that someone hadn't already claimed by assigning it to themselves. Or at least post to the issue and ask if they are still working on it (for instance if someone assigned it to themselves a week ago and there hasn't been any action on it), and if there is no response in 24 hours, then you can assign it to yourself to indicate that you are working on it. Thanks!

Meanwhile, we still need someone to test this patch manually, since there were errors as noted in #2, and they didn't cause any automated tests to fail. We need someone to figure out where all of these are displayed, and verify that the links work.

BassistJimmyJam’s picture

My apologies, I didn't actually see Dan Silver's post. I got the notification that it needed a reroll so I just did it and posted. Perhaps I should assign the issue to myself before I start working on it next time?

BassistJimmyJam’s picture

StatusFileSize
new9.6 KB

Patch no longer applies clean, rerolled.

jhodgdon’s picture

See #17. Patch still needs *manual* testing.

michaellenahan’s picture

Issue tags: -Novice, -Needs manual testing

#19: translated-urls-1471848-19.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Novice, +Needs manual testing

The last submitted patch, translated-urls-1471848-19.patch, failed testing.

jhodgdon’s picture

Issue tags: +Needs backport to D7

Looks like this patch needs a re-roll.

Also, over on #692366: Stop forcing language/mirror for PHP manual links we were just discussing that in Drupal 7, we would also like this change made (at least for the file.install strings), so I am marking this for backport.

michaellenahan’s picture

Issue tags: -Needs backport to D7
StatusFileSize
new9.6 KB

Rerolled.

michaellenahan’s picture

Status: Needs work » Needs review
albert volkman’s picture

Please don't remove the tag until the patch is accepted.

albert volkman’s picture

Issue tags: +Needs backport to D7

Please don't remove the tag until the patch is accepted.

michaellenahan’s picture

StatusFileSize
new48.53 KB

I'm doing this during core-office-hours with help from zendoodles (thanks!)
http://core.drupalofficehours.org/task/141

Next step is manual checking of the links. I'll work through the links that were altered in the patch and post screenshots here as I go. Line numbers refer to the patch in comment #24.

core/modules/file/file.install, line 70.
link appears in: admin/reports/status

$description = t('Your server is capable of displaying file upload progress through APC, but it is not enabled. Add apc.rfc1867 = 1 to your php.ini configuration. Alternatively, it is recommended to use <a href="@url">PECL uploadprogress</a>, which supports more than one simultaneous upload.', array('@url' => 'http://pecl.php.net/package/uploadprogress'));
michaellenahan’s picture

StatusFileSize
new46.89 KB

core/modules/file/file.install, line 74
links appear in: admin/reports/status

I had to cheat to manually check these two links - I found I couldn't easily remove the APC library on my local installation - so I temporarily put an elseif (true) in the code ... so this is a valid test for the Novice issue of checking the link works but doesn't confirm correct behavour with regards to the APC library being available ...

michaellenahan’s picture

StatusFileSize
new40.87 KB
new49.9 KB

core/modules/file/file.install, lines 77-78
These links appear after adding apc.rfc1867 = 1 to php.ini.

core/modules/file/file.install, line 81
link appears in: admin/reports/status
This link appears after installing http://pecl.php.net/package/uploadprogress

michaellenahan’s picture

StatusFileSize
new48.49 KB
new66.31 KB
new56.53 KB
new60.44 KB
new51.05 KB

Confirming these passed manual testing - these links all work fine as well.

core/modules/image/image.field.inc, line 87
link appears in: admin/structure/types/manage/article/fields/field_image

core/modules/image/image.install, line 91
link appears in: admin/reports/status
(I had to cheat here as well to get the link to show, by putting if (true) at line 89)

core/modules/image/image.install, line 98
link appears in: admin/reports/status
(I took a similar shortcut to get this link to show)

core/modules/search/search.module, line 87
links appear in: admin/help/search

core/modules/system/system.install, line 93
link appears in: admin/reports/status
(after disabling phpinfo as described here http://drupal.org/node/243993)

xjm’s picture

Issue tags: +needs backport to D7
Please don't remove the tag until the patch is accepted.

Actually, for the record, this tag stays on forever for historical tracking. :)

ZenDoodles’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for the reroll and tests michaellenahan! These screen shots are awesome!

dries’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to 8.x. Moving the version tag to 7.x so David and Angie can consider backporting this to 7.x.

David_Rothstein’s picture

For Drupal 7, we do need to fix a couple of these (since per #692366: Stop forcing language/mirror for PHP manual links, the issue @jhodgdon linked to above, those have incorrect URLs anyway).

I'm not sure what the benefit of fixing the others in Drupal 7 would be, though? It will break translations, without any direct benefit to either translators or users that I'm aware of (the benefit only comes if/when you actually need to change the URL, I think).

So basically, this would just be about following coding standards... which is a good thing on its own, of course :) But it's usually not enough of a reason to actually break something in a stable release.

jhodgdon’s picture

RE #35: I think we should just fix those two with the PHP languages that we need to fix on the other issue. In which case, we *could* just fix them on the other issue?

ZenDoodles’s picture

Issue tags: -Novice, -Needs manual testing
kriskd’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new8.65 KB

Here is the backport to Drupal 7.

jhodgdon’s picture

Status: Needs review » Needs work

Thanks for making this patch!

It needs a bit of work:

a) The first hunk still has us.php.net in the URL. We should take that out, see #692366: Stop forcing language/mirror for PHP manual links
b) The second still has 'en' in the URL. We should take that out, see above.
c) The third hunk -- see #35 - for Drupal 7 we decided we are not removing the URLs except for the ones that have us.php.net or php.net/en in the URLs, so that one should be skipped (and probably most of the rest of the patch).

kriskd’s picture

Status: Needs work » Needs review
StatusFileSize
new8.64 KB

Here is the patch with (hopefully) the fixes. I'm happy to get feedback if it is not yet complete.

jhodgdon’s picture

Status: Needs review » Needs work

I guess I wasn't clear in my last review... Changes like this:

-    $requirements['php_register_globals']['description'] = $t('<em>register_globals</em> is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when <em>register_globals</em> is enabled. The PHP manual has instructions for <a href="http://php.net/configuration.changes">how to change configuration settings</a>.');
+    $requirements['php_register_globals']['description'] = $t('<em>register_globals</em> is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when <em>register_globals</em> is enabled. The PHP manual has instructions for <a href="@url">how to change configuration settings</a>.', array('@url' => 'http://php.net/configuration.changes'));

We need to leave these out of the patch for D7. The URL that is in the text here is correct (it doesn't have 'en' or 'us' as part of the URL), and because changing translated strings is disruptive, for D7 we are only changing translated strings to remove URLs if there is also a problem in the URL. So this change, and others like it, need to be removed from the patch.

Thanks!

mariacha1’s picture

StatusFileSize
new13.38 KB
new7.57 KB

Hello!

I'm just going through some old novice issues trying to clean things up and came across this one.

Since it's been here a while, I wanted to write up a quick summary and include a patch.

Summary:
We're translating any links that show up in t() strings that the user sees to be non-english specific. Mostly replacing links to http://php.net/manual/en/XYZ to http://php.net/manual/XYZ

The Wrinkle:
When changing some of these links we discovered some translations that were poorly done (links that are straight in the string passed to the t() function instead of in the second parameter options array).

The conclusion:
We're only fixing those incorrect links if they're pointing to an english-specific link, but not fixing them if they're pointing to a language-neutral link, "because changing translated strings is disruptive" (see #41).

Attached is my patch to do that, as well as an interdiff between this patch and #40.

I'm also planning to submit a patch to related issue #692366: Stop forcing language/mirror for PHP manual links

mariacha1’s picture

Status: Needs work » Needs review
jhodgdon’s picture

Issue tags: +Needs manual testing

Thanks!

Since this text goes into the user interface, we need someone to test and verify that all of the links that are updated here still work, and that the formatting on those pages comes out correct.

  • Dries committed 1d4a4a2 on 8.3.x
    - Patch #1471848 by BassistJimmyJam, michaellenahan: user interface text...

  • Dries committed 1d4a4a2 on 8.3.x
    - Patch #1471848 by BassistJimmyJam, michaellenahan: user interface text...

  • Dries committed 1d4a4a2 on 8.4.x
    - Patch #1471848 by BassistJimmyJam, michaellenahan: user interface text...

  • Dries committed 1d4a4a2 on 8.4.x
    - Patch #1471848 by BassistJimmyJam, michaellenahan: user interface text...

  • Dries committed 1d4a4a2 on 9.1.x
    - Patch #1471848 by BassistJimmyJam, michaellenahan: user interface text...

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.