Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
The action method in the class seems to take parameter "options" which is not used anywhere:
/**
* Execute action on remote resource
*
* @param $resource
* Resource type i.e. 'user' or 'node'
* @param $action
* Action name i.e. 'login' or 'publish'
* @param $data
* Associative array of additional data that should be passed to call
* @param $options
* Extra options of request
*/
public function action($resource, $action, $data = array(), $options = array()) {
$this->http_request = $this->createRequest(array(
'resource' => $resource,
'action' => $action,
'data' => $data
));
return $this->processRequest()->data;
}
In the same time I think it will be usefully if there is a possibility to pass query parameters to actions as well.
I would like to propose small change from "options" to "query" in the following way:
/**
* Execute action on remote resource
*
* @param $resource
* Resource type i.e. 'user' or 'node'
* @param $action
* Action name i.e. 'login' or 'publish'
* @param $data
* Associative array of additional data that should be passed to call
* @param $query
* Extra options of request
*/
public function action($resource, $action, $data = array(), $query = array()) {
$this->http_request = $this->createRequest(array(
'resource' => $resource,
'action' => $action,
'data' => $data,
'query' => $query,
));
return $this->processRequest()->data;
}
As the query is already supported in the request processing, this should work right away.
Regards,
Lachezar
Comment | File | Size | Author |
---|---|---|---|
#2 | services_client-support_query-2609118-2.patch | 1.35 KB | lachezar.valchev |
Comments
Comment #2
lachezar.valchev CreditAttribution: lachezar.valchev at FFW commentedHi,
Here is a patch with the proposed change.
Regards,
Lachezar