From dc1d6b63416b9285187b349cca59b8793baaa477 Mon Sep 17 00:00:00 2001 From: boombatower Date: Wed, 2 May 2012 01:46:18 -0500 Subject: [PATCH] Remove temporary fix for services change with a proper fix for the resource paramters. --- includes/api.inc | 20 -------------------- includes/services.inc | 14 +++++++------- 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/includes/api.inc b/includes/api.inc index d95a7ce..cd19f87 100644 --- a/includes/api.inc +++ b/includes/api.inc @@ -16,11 +16,6 @@ * @see conduit_queue_claim() */ function conduit_api_claim($category) { - // Fix for services which passes all parameters as an associative array. - if (is_array($category)) { - extract($category); - } - conduit_include('queue'); if ($properties = conduit_queue_claim($category)) { $item = $properties['item']; @@ -53,11 +48,6 @@ function conduit_api_claim($category) { * TRUE if successfull, otherwise FALSE. */ function conduit_api_result($item, $status, $result, $log, $duration) { - // Fix for services which passes all parameters as an associative array. - if (is_array($item)) { - extract($item); - } - $item = (object) $item; // Acquire a lock to modify the node. @@ -138,11 +128,6 @@ function conduit_api_result($item, $status, $result, $log, $duration) { * TRUE if the job node was found and repeated, otherwise FALSE. */ function conduit_api_repeat($nid, $force = FALSE) { - // Fix for services which passes all parameters as an associative array. - if (is_array($nid)) { - extract($nid); - } - if (($node = node_load($nid)) && ($force || conduit_node_repeat_access($node))) { $node->revision = TRUE; node_save($node); @@ -162,11 +147,6 @@ function conduit_api_repeat($nid, $force = FALSE) { * @see lock_release() */ function conduit_api_lock_acquire($nid) { - // Fix for services which passes all parameters as an associative array. - if (is_array($nid)) { - extract($nid); - } - $lock = 'conduit_api_' . $nid; while (!lock_acquire($lock)) { sleep(1); diff --git a/includes/services.inc b/includes/services.inc index f4322b4..0c58734 100644 --- a/includes/services.inc +++ b/includes/services.inc @@ -23,7 +23,7 @@ function conduit_services_resources() { 'name' => 'category', 'type' => 'string', 'description' => 'The job category from which to claim an item.', - 'source' => 'data', + 'source' => array('data' => 'category'), 'optional' => FALSE, ), ), @@ -38,35 +38,35 @@ function conduit_services_resources() { 'name' => 'item', 'type' => 'array', 'description' => 'Queue item the results are related to.', - 'source' => 'data', + 'source' => array('data' => 'item'), 'optional' => FALSE, ), array( 'name' => 'status', 'type' => 'int', 'description' => 'Chunk result status.', - 'source' => 'data', + 'source' => array('data' => 'status'), 'optional' => FALSE, ), array( 'name' => 'result', 'type' => 'array', 'description' => 'The result of processing the chunk.', - 'source' => 'data', + 'source' => array('data' => 'result'), 'optional' => FALSE, ), array( 'name' => 'log', 'type' => 'string', 'description' => 'The log generated while processing the chunk.', - 'source' => 'data', + 'source' => array('data' => 'log'), 'optional' => FALSE, ), array( 'name' => 'duration', 'type' => 'int', 'description' => 'Indicates the the length of time elapsed processing the chunk.', - 'source' => 'data', + 'source' => array('data' => 'duration'), 'optional' => FALSE, ), ), @@ -86,7 +86,7 @@ function conduit_services_resources() { 'name' => 'id', 'type' => 'int', 'description' => 'Job node ID to repeat.', - 'source' => 'data', + 'source' => array('data' => 'id'), 'optional' => FALSE, ), ),