API page: https://api.drupal.org/api/drupal/includes%21database%21database.inc/gro...
"one might wish to return a list of the most recent 10 nodes authored by a given user"
The query presented doesn't do "ORDER BY n.created DESC" so it will present 10 entries, but they may not be recent.
Comment | File | Size | Author |
---|---|---|---|
#20 | 2194027-20.patch | 960 bytes | KelvinWong |
#17 | 2194027-17.patch | 594 bytes | KelvinWong |
#6 | 2194027-6.patch | 952 bytes | KelvinWong |
Comments
Comment #1
jhodgdonThanks for filing this issue -- good catch!
This needs to be fixed in 8.x first (same docs there).
Comment #2
KelvinWong CreditAttribution: KelvinWong commentedI have updated the documentation. Please review :)
Comment #3
sphism CreditAttribution: sphism commentedI'll do this now (in DrupalSouth code sprint) .... edit, it's just been done, so i'll review it :)
Comment #4
sphism CreditAttribution: sphism commentedWhy does that patch say deleted?
Comment #5
sphism CreditAttribution: sphism commentedIf ORDER BY is on a separate line, should FROM and WHERE each be on separate lines as well? I'm not sure of the convention for this
Comment #6
KelvinWong CreditAttribution: KelvinWong commentedI break it to a new line because it excess the 80 characters limit on a line. Just found a mistake on the patch, attached a new one.
Comment #7
sphism CreditAttribution: sphism commentedI didn't think the 80 char limit applied to code blocks.... hmmm i could be wrong.
i'm not sure where you would break the line, it's usually word wrapped at the last word that goes over 80 chars regardless of what looks right.
I assume we are in the same code sprint, where are you?
Comment #8
sphism CreditAttribution: sphism commentedSome things in your @code blocks are indented, should they be? I'm not sure and the comment guidelines don't help with multi line code comments:
https://drupal.org/node/1354#code
Comment #9
KelvinWong CreditAttribution: KelvinWong commentedI am sitting at the table near the entry, there are 3 people only at my table.
May be it shouldn't be indented in the @code blocks, I will check it out. Thanks.
Comment #10
jhodgdonIt is fine to indent in code blocks, and while they can go over 80 lines, really long lines do not display well on api.drupal.org. The main thing is to keep them readable. :)
So I think this patch is fine. Thanks!
Comment #11
danblack CreditAttribution: danblack commentedThanks for the patch folks. Works for me. I really enjoyed Drupal South. So much so I forgot to check back on this bug.
Comment #12
jhodgdonThanks again! Committed to 8.x.
I cannot get this to apply easily to 7.x, so this needs a port.
Comment #13
sphism CreditAttribution: sphism commentedThat's odd, I visited KelvinWong's user page and it doesn't mention he got a core commit, shouldn't it say something like:
Drupal core (1 commit)
???
Comment #14
droplet CreditAttribution: droplet commented@splhism,
CORE commit won't show on User Profiles. Yeah. It's odd design.
Comment #15
KelvinWong CreditAttribution: KelvinWong commentedYay, my first contribution to Drupal core. Thanks for giving me the opportunity, and thanks everyone for your time to look at my patch and give comments. I will checkout the 7.x port.
Many Thanks.
Comment #16
jhodgdonRE #13 - Nearly every Drupal Core commit involves multiple contributors (making patches, reviewing, etc.). Git only allows us to give one person credit for the patch. So, we use a different system in the Drupal Core patch, where we use the commit message to assign credit. If you go to the Drupal Core project and review the recent commits, you will find the drupal.org user names of (hopefully) everyone who contributed to a particular commit mentioned in the commit message. And when we recognize contributions to Drupal Core, we look at the content of those commit messages. Hope that explanation helps...
Comment #17
KelvinWong CreditAttribution: KelvinWong commentedPlease find attached patch for 7.x
Comment #18
sphism CreditAttribution: sphism commentedThanks jhodgdon, that explains it.
For people just starting out it's a huge encouragement to get that little bit of recognition on your profile page for what many have been a great many hours work.
Comment #19
jhodgdonRE #18, sorry, but that's not under my control. For further discussion, please see:
#2042697: Add historical issue credits to Drupal.org user profile
and related issues.
Also see
https://drupal.org/node/52287
RE #17 - when you upload a patch, you need to set the status to "Needs Review". Thanks! However, in this case I don't think the patch is complete. It is missing lines that are in the 8.x patch.
Comment #20
KelvinWong CreditAttribution: KelvinWong commentedSorry, forgot to update those in @code. New patch uploaded, please review.
Comment #21
jhodgdonThanks!
Comment #22
jhodgdonThanks again! Committed to 7.x.