I am querying my Drupal site to find a particular node by its title, by calling eg. node.index(0, '*', {'title': 'Hello, world'}). However, the code (services_resource_build_index_query) interprets this query to mean that I am looking for either a node titled "Hello" or a node titled " world". There is no way to perform the search I need using the services API.

I suggest that instead of assuming $parameter_value is a comma-delimited string, allow it to either be a string or an array of strings.

Comments

SpindleyQ’s picture

StatusFileSize
new743 bytes

See attached patch for a simple fix.

marcingy’s picture

Status: Active » Postponed

the real answer is that the values should be an array so postponing for 7.x.4 but good idea but we need to do this correctly.

marcingy’s picture

Status: Postponed » Needs work

This looks like more a general issue we need something that works and its as nice as it could be.

glennpratt’s picture

StatusFileSize
new2.31 KB

Here's my rough patch, just curious what you think about the approach to use CSV style strings, and re-implementing a PHP function as needed.

This would allow:

title="i,Robot",Blah

The code was based from PHP.net comments.

cotto’s picture

Status: Needs work » Postponed
StatusFileSize
new1.45 KB

Here's a version of the patch (which is for 6.x-3.x, btw) that removes the whitespace changes and puts all the conditional logic into a wrapper function. I'm not certain what the docs for the wrapper should look like, but that's my best guess. Something like this patch will also be required for 7.x-3.x since it only requires PHP 5.2.5 or higher.

cotto’s picture

Version: 7.x-3.1 » 6.x-3.x-dev
Status: Postponed » Needs review
kylebrowning’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Needs review » Patch (to be ported)

looks good, can we get a 7.x version?

cotto’s picture

StatusFileSize
new1.21 KB

Here you go. I did some very basic testing and it seems to work correctly.

kylebrowning’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.