updated webform localization and phone, uuid, term_merge, spambot, performance
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Field Collection services definition functions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Define a services resource for field_collections.
|
||||
*/
|
||||
function _field_collection_resource_definition() {
|
||||
if (module_exists('field_collection')) {
|
||||
// We will allow uuid_services_services_resources_alter() to add the
|
||||
// default UUID-related operations to this resource.
|
||||
return array('field_collection_item' => array());
|
||||
}
|
||||
else {
|
||||
return array();
|
||||
}
|
||||
}
|
@@ -1,7 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Administration functions for UUID Service module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Settings form for UUID Services.
|
||||
*
|
||||
* @return array
|
||||
* Configuration form structure.
|
||||
*/
|
||||
function uuid_services_settings() {
|
||||
$form['uuid_services_support_all_entity_types'] = array(
|
||||
|
@@ -7,9 +7,9 @@ dependencies[] = services
|
||||
dependencies[] = uuid
|
||||
dependencies[] = entity
|
||||
|
||||
; Information added by Drupal.org packaging script on 2014-09-23
|
||||
version = "7.x-1.0-alpha6"
|
||||
; Information added by Drupal.org packaging script on 2016-08-02
|
||||
version = "7.x-1.0-beta2"
|
||||
core = "7.x"
|
||||
project = "uuid"
|
||||
datestamp = "1411455150"
|
||||
datestamp = "1470153540"
|
||||
|
||||
|
@@ -1,16 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Implementation of hook_menu().
|
||||
* @file
|
||||
* UUID Services module functions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_menu().
|
||||
*/
|
||||
function uuid_services_menu() {
|
||||
$items['admin/config/services/uuid-services'] = array(
|
||||
'title' => 'UUID Services',
|
||||
'description' => 'Configure settings for Module Filter.',
|
||||
'description' => 'Configure settings for UUID Services.',
|
||||
'access arguments' => array('administer services'),
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('uuid_services_settings'),
|
||||
'file' => 'uuid_services.admin.inc'
|
||||
'file' => 'uuid_services.admin.inc',
|
||||
);
|
||||
return $items;
|
||||
}
|
||||
@@ -158,7 +163,15 @@ function _uuid_services_entity_update($entity_type, $uuid, $entity) {
|
||||
*/
|
||||
function _uuid_services_entity_delete($entity_type, $uuid) {
|
||||
try {
|
||||
$return = entity_uuid_delete($entity_type, array($uuid));
|
||||
$uuid_exist = (bool) entity_get_id_by_uuid($entity_type, array($uuid));
|
||||
if (!$uuid_exist) {
|
||||
/* UUID not found. Don't try to delete something that doesn't exist. */
|
||||
$args = array('@uuid' => $uuid, '@type' => $entity_type);
|
||||
watchdog('uuid_services', 'UUID @uuid not found for entity type @type', $args, WATCHDOG_WARNING);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
$return = entity_uuid_delete($entity_type, array($uuid)) !== FALSE;
|
||||
return $return;
|
||||
}
|
||||
catch (Exception $exception) {
|
||||
@@ -170,14 +183,14 @@ function _uuid_services_entity_delete($entity_type, $uuid) {
|
||||
/**
|
||||
* Access callback.
|
||||
*
|
||||
* @param $op
|
||||
* @param string $op
|
||||
* The operation we are trying to do on the entity. Can only be:
|
||||
* - "view"
|
||||
* - "update"
|
||||
* - "delete"
|
||||
* See 'uuid_services_services_resources_alter()' for an explanation why
|
||||
* 'create' is missing.
|
||||
* @param $args
|
||||
* @param array $args
|
||||
* The arguments passed to the method. The keys are holding the following:
|
||||
* 0. <entity_type>
|
||||
* 1. <uuid>
|
||||
@@ -208,10 +221,9 @@ function _uuid_services_entity_access($op, $args) {
|
||||
if ($op == 'update' && empty($entity_ids)) {
|
||||
$op = 'create';
|
||||
}
|
||||
// Taxonomy and Comment module uses 'edit' instead of 'update'.
|
||||
// Oh, how I love Drupal consistency.
|
||||
if (($entity_type == 'taxonomy_term' || $entity_type == 'comment') && $op == 'update') {
|
||||
$op = 'edit';
|
||||
// If the user doesn't exist return 406 like services does.
|
||||
if (($entity_type == 'user' && empty($entity) && $op == 'view')) {
|
||||
return services_error(t('There is no user with UUID @uuid.', array('@uuid' => $args[1])), 406);;
|
||||
}
|
||||
// The following code is taken from entity_access() with some extra logic
|
||||
// to handle the case where an entity type is not defining an access
|
||||
@@ -227,18 +239,3 @@ function _uuid_services_entity_access($op, $args) {
|
||||
return services_error($exception, 406, $entity_type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_services_resources().
|
||||
*/
|
||||
function uuid_services_services_resources() {
|
||||
module_load_include('inc', 'uuid_services', 'resources/field_collection.resource');
|
||||
|
||||
$resources = array(
|
||||
'#api_version' => 3002,
|
||||
);
|
||||
|
||||
$resources += _field_collection_resource_definition();
|
||||
|
||||
return $resources;
|
||||
}
|
||||
|
Reference in New Issue
Block a user