Skip to content

Instantly share code, notes, and snippets.

@chrisns
Created March 25, 2011 15:00
Show Gist options
  • Save chrisns/886968 to your computer and use it in GitHub Desktop.
Save chrisns/886968 to your computer and use it in GitHub Desktop.
diff --git resources/node_resource.inc resources/node_resource.inc
index 1454a2d..fa9dce3 100644
--- resources/node_resource.inc
+++ resources/node_resource.inc
@@ -92,7 +92,7 @@ function _node_resource_definition() {
),
),
'access arguments' => array('access content'),
- 'access arguments append' => TRUE,
+ // 'access arguments append' => TRUE,
),
),
);
@@ -153,7 +153,7 @@ function _node_resource_create($node) {
function _node_resource_update($nid, $node) {
$node = (object)$node;
- $node->nid = $nid;
+ $node->nid = arg(2);
$old_node = node_load($node->nid);
if ($old_node->nid) {
@@ -161,7 +161,7 @@ function _node_resource_update($nid, $node) {
module_load_include('inc', 'node', 'node.pages');
// Setup form_state.
- $values = (array)$node;
+ $values = (array)$nid;
$form_state = array();
$form_state['values'] = $values;
$form_state['values']['op'] = t('Save');
@@ -208,7 +208,7 @@ function _node_resource_index($page = 0, $fields = array(), $parameters = array(
else {
$sql = "SELECT * FROM {node} WHERE status = 1 ORDER BY sticky DESC, created DESC";
}
- $res = db_query_range($sql, $params, $page * 20, 20);
+ $res = db_query_range($sql, $params, $page * 20, 20000);
$events = array();
while ($event = db_fetch_object($res)) {
diff --git services.module services.module
index 7fc7a2c..766f820 100644
--- services.module
+++ services.module
@@ -365,19 +365,20 @@ function services_endpoint_list() {
* Optional. The endpoint endpoint that's being used.
* @return array
* An array containing all resources.
+ * HACK CNS: neutered all the caching
*/
function services_get_resources($endpoint_name = '') {
- $cache_key = 'services:' . $endpoint_name . ':resources';
+ // $cache_key = 'services:' . $endpoint_name . ':resources';
$resources = array();
- if (($cache = cache_get($cache_key)) && isset($cache->data)) {
- $resources = $cache->data;
- }
- else {
+ // if (($cache = cache_get($cache_key)) && isset($cache->data)) {
+ // $resources = $cache->data;
+ // }
+ // else {
module_load_include('resource_build.inc', 'services');
$resources = _services_build_resources($endpoint_name);
- cache_set($cache_key, $resources);
- }
+ // cache_set($cache_key, $resources);
+ // }
return $resources;
}
diff --git services.runtime.inc services.runtime.inc
index f3a7e3e..11b61a2 100644
--- services.runtime.inc
+++ services.runtime.inc
@@ -464,9 +464,9 @@ function _comment_resource_access($op = 'view', $args = array()) {
*/
function _file_resource_access($op = 'view', $args = array()) {
global $user;
- if (user_access('administer files')) {
+ // if (user_access('administer files')) {
return TRUE;
- }
+ // }
if ($op=='create') {
$file = (object)$args[0];
@@ -506,6 +506,7 @@ function _node_resource_access($op = 'view', $args = array()) {
if ($op != 'create' && !empty($args)) {
$node = node_load($args[0]);
}
+ return true; // HACK CNS node resource doesn't actually get the node in the args
return node_access($op, $node);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment