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
Comment #1
BassistJimmyJam commentedComment #2
jhodgdonThanks! The patch is mostly correct, but I found two problems:
a)
uploadprogress_url is missing @ in the replace array.
b)
@sphinx_url is misspelled as @sphnik_url in the t() text.
Comment #3
BassistJimmyJam commentedAddressed comments in #2.
Comment #4
jhodgdonLooks good then, thanks!
Comment #5
jhodgdonActually, 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.
Comment #6
jhodgdonI think I had the wrong testing tag
Comment #7
Dan Silver commentedHey,
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:
Comment #8
jhodgdon#3: translated-urls-1471848-3.patch queued for re-testing.
Comment #9
jhodgdonHmmm. 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...
Comment #11
jhodgdonOK, looks like the patch above needs a reroll.
Comment #12
Dan Silver commentedThis should be within my skill range. I'll give it a try!
Comment #13
BassistJimmyJam commentedRerolled.
Comment #15
BassistJimmyJam commentedHmm... missed a closing parenthesis.
Comment #16
Dan Silver commentedComment #17
jhodgdonHey 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.
Comment #18
BassistJimmyJam commentedMy 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?
Comment #19
BassistJimmyJam commentedPatch no longer applies clean, rerolled.
Comment #20
jhodgdonSee #17. Patch still needs *manual* testing.
Comment #21
michaellenahan commented#19: translated-urls-1471848-19.patch queued for re-testing.
Comment #23
jhodgdonLooks 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.
Comment #24
michaellenahan commentedRerolled.
Comment #25
michaellenahan commentedComment #26
albert volkman commentedPlease don't remove the tag until the patch is accepted.
Comment #27
albert volkman commentedPlease don't remove the tag until the patch is accepted.
Comment #28
michaellenahan commentedI'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
Comment #29
michaellenahan commentedcore/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 ...
Comment #30
michaellenahan commentedcore/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
Comment #31
michaellenahan commentedConfirming 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)
Comment #32
xjmActually, for the record, this tag stays on forever for historical tracking. :)
Comment #33
ZenDoodles commentedThank you for the reroll and tests michaellenahan! These screen shots are awesome!
Comment #34
dries commentedCommitted to 8.x. Moving the version tag to 7.x so David and Angie can consider backporting this to 7.x.
Comment #35
David_Rothstein commentedFor 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.
Comment #36
jhodgdonRE #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?
Comment #37
ZenDoodles commentedComment #38
kriskd commentedHere is the backport to Drupal 7.
Comment #39
jhodgdonThanks 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).
Comment #40
kriskd commentedHere is the patch with (hopefully) the fixes. I'm happy to get feedback if it is not yet complete.
Comment #41
jhodgdonI guess I wasn't clear in my last review... Changes like this:
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!
Comment #42
mariacha1 commentedHello!
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
Comment #43
mariacha1 commentedComment #44
jhodgdonThanks!
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.