-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return all nodes when invoking node_load_multiple()
#5437
Comments
If this looks like the right approach to fix this, I can also create issues and PRs for the xxx_load_multiple of all other 4 core entities. |
As a "bonus" fix we could possibly call |
I believe this'd be an API change and would therefore need to wait for v2.0... |
It's a little weird that In any event, in the current version it would be nice to have the magic value of FALSE and its result documented for |
Hmm... I don't quite see it as an API change, but rather as a bug. Could we at least document (in the PHP docs above the function) the unusual approach needed to get all nodes with |
|
Sure. But to fix the bug you need to change the API, hence the API change. @argiepiano If you'd like this issue to be used to update the documentation for now, please create a separate issue for fixing this in 2.x. Otherwise open a new issue for updating the documentation and we can leave this issue for the 2.x fix. |
Description of the bug
Currently invoking
node_load_multiple();
with no arguments returns an empty array. On the other hand, invokingentity_load_multiple('node');
(which is a parallel function) correctly returns all nodes as expected.In order to get all nodes, you must invoke
node_load_multiple(FALSE);
.I don't know if this is "working as designed". In my view, it would make sense for
node_load_multiple()
without arguments to function the same way asentity_load_multiple('node');
. Plus usingnode_load_multiple(FALSE)
to return all nodes seems somewhat contrived.Steps To Reproduce
node_load_multiple();
in a custom module or inside Devel'sdpm()
and output the result.Actual behavior
The invocation returns an empty array.
Expected behavior
The invocation should return an array of all nodes in the system.
Additional information
A possible solution is to make the optional $ids parameter in
node_load_multiple
default to FALSE rather than to array(), which matchesentity_load_multiple()
. I can provide a PR.Add any other information that could help, such as:
The text was updated successfully, but these errors were encountered: