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

Comments

lachezar.valchev created an issue. See original summary.

lachezar.valchev’s picture

Status: Needs work » Needs review
StatusFileSize
new1.35 KB

Hi,

Here is a patch with the proposed change.

Regards,
Lachezar