Skip to content

Commit

Permalink
#15 Update Services to 7.x-3.28
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Hunt committed May 6, 2022
1 parent 144efc4 commit fcab1c5
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docroot/sites/all/modules/contrib/services/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ http://drupal.org/node/109782
Installation
============
If you are using the rest server you will need to download the latest version of SPYC:
wget https://raw.github.com/mustangostang/spyc/0.5.1/Spyc.php -O sites/all/libraries/spyc/spyc.php
wget https://raw.github.com/mustangostang/spyc/0.6.2/Spyc.php -O sites/all/libraries/spyc/spyc.php

Once downloaded you need to add spyc.php to the rest_server/lib folder which exists under
the location you have installed services in.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ dependencies[] = services
dependencies[] = oauth_common
core = 7.x
php = 5.2
; Information added by Drupal.org packaging script on 2020-06-03
version = "7.x-3.27"
; Information added by Drupal.org packaging script on 2022-04-21
version = "7.x-3.28"
core = "7.x"
project = "services"
datestamp = "1591213031"
datestamp = "1650563150"
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
*/
Drupal.behaviors.resourceMenuCollapse = {
attach: function (context, settings) {
var timeout = null,
arrowImageHTML = function(collapsed) {
var arrowImageHTML = function(collapsed) {
return settings.services.images[collapsed ? 'collapsed' : 'expanded'];
},
setRowsCollapsedState = function(toggle, $rows, collapsed) {
Expand All @@ -18,7 +17,7 @@
$(toggle).html(arrowImageHTML(collapsed));
};

$('td.resource-select-all').each(function() {
$('td.resource-select-all').once('resource-menu-collapse').each(function() {
var resourceName = this.id,
resource = settings.services.resources[this.id],
$rowElements = $('.' + resourceName + '-method'),
Expand All @@ -43,7 +42,7 @@
*/
Drupal.behaviors.resourceSelectAll = {
attach: function (context, settings) {
$('td.resource-select-all').each(function () {
$('td.resource-select-all').once('resource-select-all').each(function () {
var resourceName = this.id,
methodCheckboxes = $('.' + resourceName + '-method .resource-method-select input[type=checkbox]'),
groupCheckbox = $('<input type="checkbox" class="form-checkbox" />').attr('id', this.id + '-select-all'),
Expand All @@ -70,4 +69,4 @@
});
}
};
})(jQuery);
})(jQuery);
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ function _comment_resource_access($op = 'view', $args = array()) {
case 'edit':
return comment_access('edit', $comment);
case 'create':
if (!isset($comment->nid)) {
return services_error(t('Missing required argument nid'), 406);
}
// Check if the user may post comments, node has comments enabled
// and that the user has access to the node.
return user_access('post comments') && ($node->comment == COMMENT_NODE_OPEN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,10 @@ function _taxonomy_resource_definition() {
*/
function _taxonomy_term_resource_retrieve($tid) {
$term = taxonomy_term_load($tid);
//Lets check field_permissions
$term = services_field_permissions_clean('view', 'taxonomy_term', $term);
return $term;
// Let's check field_permissions and return term object
return $term ?
services_field_permissions_clean('view', 'taxonomy_term', $term) :
services_error(t('Term @tid not found', array('@tid' => $tid)), 404);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ class RESTServer {
);
drupal_alter('rest_server_execute_errors', $error_alter_array, $controller, $arguments);

drupal_add_http_header('Status', strip_tags(str_replace(PHP_EOL, '', $error_header_status_message)));
drupal_add_http_header('Status', strip_tags(str_replace(array("\r", "\n"), '', $error_header_status_message)));

return $error_data;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ dependencies[] = libraries (>=2.x)

core = 7.x

; Information added by Drupal.org packaging script on 2020-06-03
version = "7.x-3.27"
; Information added by Drupal.org packaging script on 2022-04-21
version = "7.x-3.28"
core = "7.x"
project = "services"
datestamp = "1591213031"
datestamp = "1650563150"
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,8 @@ function _rest_server_add_default_and_remove_unknown(&$array, $keys, $default) {
function rest_server_libraries_info() {
$libraries['spyc'] = array(
'name' => 'Spyc',
'version' => '0.5.1',
'vendor url' => 'https://github.com/mustangostang/spyc',
'download url' => 'https://raw.github.com/mustangostang/spyc/0.5.1/Spyc.php',
'download url' => 'https://raw.github.com/mustangostang/spyc/0.6.2/Spyc.php',
'version arguments' => array(
'file' => 'Spyc.php',
'pattern' => '@version\s+([0-9a-zA-Z\.-]+)@',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ files[] = xmlrpc_server.module
dependencies[] = services

core = 7.x
; Information added by Drupal.org packaging script on 2020-06-03
version = "7.x-3.27"
; Information added by Drupal.org packaging script on 2022-04-21
version = "7.x-3.28"
core = "7.x"
project = "services"
datestamp = "1591213031"
datestamp = "1650563150"
6 changes: 3 additions & 3 deletions docroot/sites/all/modules/contrib/services/services.info
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ dependencies[] = ctools
; Required for test coverage.
test_dependencies[] = libraries

; Information added by Drupal.org packaging script on 2020-06-03
version = "7.x-3.27"
; Information added by Drupal.org packaging script on 2022-04-21
version = "7.x-3.28"
core = "7.x"
project = "services"
datestamp = "1591213031"
datestamp = "1650563150"
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ core = 7.x
; Libraries
libraries[spyc][directory_name] = spyc
libraries[spyc][download][type] = file
libraries[spyc][download][url] = https://raw.github.com/mustangostang/spyc/0.5.1/Spyc.php
libraries[spyc][download][url] = https://raw.github.com/mustangostang/spyc/0.6.2/Spyc.php
libraries[spyc][type] = library
5 changes: 3 additions & 2 deletions docroot/sites/all/modules/contrib/services/services.module
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,9 @@ function services_request_apply_version(&$controller, $options = array()) {
return;
}
$updates = services_get_updates();
if (isset($method) && isset($updates[$resource][$method])) {
foreach ($updates[$resource][$method] as $update) {
$resource_clean_name = str_replace('-', '_', $resource);
if (isset($method) && isset($updates[$resource_clean_name][$method])) {
foreach ($updates[$resource_clean_name][$method] as $update) {
if (!isset($version)) {
$endpoint = services_get_server_info('endpoint', '');
$endpoint = services_endpoint_load($endpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ hidden = TRUE

dependencies[] = services

; Information added by Drupal.org packaging script on 2020-06-03
version = "7.x-3.27"
; Information added by Drupal.org packaging script on 2022-04-21
version = "7.x-3.28"
core = "7.x"
project = "services"
datestamp = "1591213031"
datestamp = "1650563150"

0 comments on commit fcab1c5

Please sign in to comment.