Posted by chx on June 23, 2005 at 6:37pm
9 followers
| Project: | Drupal core |
| Component: | node system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | chx |
| Status: | closed (fixed) |
Issue Summary
I am fed up writing node_load(array('nid' => $nid)) all the time.
BTW. if this is accepted, next is node_view to accept a $nid.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| node_load.patch | 2.23 KB | Ignored: Check issue status. | None | None |
Comments
#1
#2
I am going to +1 this.
node_load(x) is much more natural to type. Having it use an array if found is useful too though.
#3
Dries, if I remember correctly, you favoured this approach.
#4
PHPdoc.
#5
+1
It's not only about lazy developers -which I am ;-)- it's also about shorter code => less errors, easier to catch
#6
The patch and its consequences makes me love the version at http://drupal.org/node/25634#comment-33584 more, but Dries will be the one to decide.
#7
A few things slipped in from another patch which should not be here.
#8
Same problem as above.
#9
I like this! Is there a similar issue for user_load()?
#10
I definitely prefer the version where we simply allow $conditions to be passed as an integer, rather than introducing additional parameters.
It matches PHP's convention of having "mixed" argument types for some functions for shorthands (e.g. str_replace allows array arguments to compact multiple replacements in one statement). And not unimportant: it does not break backwards compatibility for what it essentially syntactic sugar.
#11
Steven. Dries did not like that version hence the additional parameter.
Dries, now that even Steven is on my side, would you please reconsider :) ?
#12
I concurr about the mixed parameter.
#13
let me weigh in +1 on the mixed parameter side ... let's get away from blowing up backwards compatibility unless it's justified and/or unavoidable for the sake of progress. please :)
#14
#15
poor book module remained unpatched.
#16
wrong version.
#17
I thought this had hit the trunk some days ago.. Chx, can you or Dries confirm and mark this issue as "Fixed"?
#18
This has been committed. Marking it 'fixed'.
#19
#20
#21
#22
#23
#24