Rest Can';t使用drupal服务注册用户(错误响应500服务不可用)
使用,Rest Can';t使用drupal服务注册用户(错误响应500服务不可用),rest,drupal,drupal-7,user-registration,drupal-services,Rest,Drupal,Drupal 7,User Registration,Drupal Services,使用, Drupal 7.x, 服务3.x 一切正常, 登录 获取所有节点 注销 获取代币等 只有在注册新用户时,我才能获得响应500服务不可用 试着这样做 { "name":"user343", "pass":"kes35@r4", "mail":"user343@sample.com", "status":"1" } 发布方法 到 xyz.com/rest/user/register 休息是终点 像这样发布注册数据 { "name":"user343", "pass":"kes35@r4"
Drupal 7.x,
服务3.x 一切正常,
登录
获取所有节点
注销
获取代币等
只有在注册新用户时,我才能获得响应500服务不可用
试着这样做
{
"name":"user343",
"pass":"kes35@r4",
"mail":"user343@sample.com",
"status":"1"
}
发布方法
到
xyz.com/rest/user/register
休息是终点
像这样发布注册数据
{
"name":"user343",
"pass":"kes35@r4",
"mail":"user343@sample.com",
"status":"1"
}
您的错误是由drupal服务模块中的错误验证调用引起的。这是一个很难找到的问题。请尝试在services/resources/user_resource.inc文件中进行快速修补
diff --git a/resources/user_resource.inc b/resources/user_resource.inc
index 04801fb..7693f2d 100644
--- a/resources/user_resource.inc
+++ b/resources/user_resource.inc
@@ -335,14 +335,6 @@ function _user_resource_create($account) {
// Execute the register form.
$form_state['programmed_bypass_access_check'] = FALSE;
- // Ensure this is validated, as drupal_form_submit will not call validation.
- user_register_validate('user_register_form', $form_state);
- $errors = form_get_errors();
- // If there are errors, then short circuit and return early.
- if ($errors) {
- return services_error(implode(' ', $errors), 406, array('form_errors' => $errors));
- }
-
drupal_form_submit('user_register_form', $form_state);
// find and store the new user into the form_state
if(isset($form_state['values']['uid'])) {
如果您对标准补丁感到不舒服,您可以注释掉这些行以快速应用手动修复。信息来源于。继续享受Drupal