When trying to use for example this: http://domain/endpoint/node?fields=nid,vid&parameters[nid]=7&parameters[...
only a unfiltered list of nodes is returned.

It seems that _node_resource_index is not using parameters to create WHERE clause.
Is there a fix or workaround for this?

CommentFileSizeAuthor
#5 param.patch3.37 KBdpi
#3 node_params.patch779 bytesdpi

Comments

kylebrowning’s picture

Category: bug » support
dpi’s picture

+1

Would like to know what is going on with 7.x-3.x resources, node and user, that implement INDEX. They do not make use of $parameters at all in their query.

dpi’s picture

Category: support » bug
StatusFileSize
new779 bytes

I haven't done the research to ensure that this is secure, but I imagine we are looking for something like this.

See attached patch.

The user resource will also need this.

kylebrowning’s picture

Status: Active » Closed (fixed)

Fixed, thanks

dpi’s picture

Title: node index not using parameters » Node and User index not using parameters
Status: Closed (fixed) » Needs review
StatusFileSize
new3.37 KB

There was some code added in addition to the patch I provided that is causing the parameter functionality to fail.

We should not be checking if $parameters is an array, it is an object. I have updated this check to object checking, and have made the default arguments more clear about this.

Attached is a patch that fixes the node index functionality, and fixes parameter functionality for the user index.

kylebrowning’s picture

Status: Needs review » Closed (fixed)

Woops, thanks