Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Jun 2010 at 13:14 UTC
Updated:
3 Jan 2014 at 01:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
solotandem commentedOne line patch.
Comment #2
jhodgdonGood catch!
The examples here:
http://api.drupal.org/api/function/drupal_mail/7
indeed are using t() incorrectly.
Two problems: (a) the line above needs to be fixed too, and (b) you need to name your patch something.patch rather than something.txt so that the test bot will pick it up and test it.
As a note, I grepped through the entire Drupal 7 source code and didn't find any other places where t() was incorrectly illustrated like this in doxygen comments. It's a bit unusual to pass a language in an example...
Redoing this patch to fix the two problems would be a good project for a documentation novice contributor....
Comment #3
jhodgdonComment #4
solotandem commentedHad to laugh at both (a) and (b) in #2. I had intended to fix both occurrences and did not notice the .txt extension. Here's a new patch from this novice.
Comment #5
jhodgdonThat's better. :)
So... One more change I can suggest, if you don't mind making one more patch: There is a global called $language, so probably in this example it would be better if the local $language variable was called something else. It's not a good practice to use local variables named the same as global ones (and I realize this isn't your fault, but if we're fixing the example, maybe we can actually make it decent code? :) ).
And when you submit a patch, you also have to set the status to "needs review" to launch the test bot on it. :)
Comment #6
solotandem commentedLet's see if this third time is a charm.
Comment #7
jhodgdonAlmost there... With that patch, the sample code has become:
So, in the second line of the function body, what is $language -- not defined. Also, apparently user_mail_tokens() has changed too:
http://api.drupal.org/api/function/user_mail_tokens/7
Comment #8
solotandem commentedTry this.
Comment #9
jhodgdonLooks good. Thanks for your persistence!
Comment #10
jhodgdon#8: 830304-core-mail.patch queued for re-testing.
Comment #11
dries commentedCommitted to CVS HEAD. Thanks.