Skip to content

Cloud Code Response Error #517

Closed
Closed
@YousefAlsbaihi

Description

@YousefAlsbaihi

New Issue Checklist

Issue Description

I create a cloud function that create users and i called it using PHP, not it's creating users fine and all good in Parse
but the response is not there, all i get is error

A PHP Error was encountered
Severity: Warning

Message: Undefined array key "result"

Filename: Parse/ParseCloud.php

Line Number: 40

Steps to reproduce

Create a cloud function using this code

Parse.Cloud.define("createNewUser", async (request) => {
    var User = Parse.Object.extend("User");
    var us = new User();
    us.set("username", request.params.username);
    us.set("name", request.params.name);
    us.set("email", request.params.email);
    us.set("password", request.params.password);
    await us.save()
        .then((user) => {
            // Execute any logic that should take place after the object is saved.
            return ('New object created with objectId: ' + user.id);
        }, (error) => {
            // Execute any logic that should take place if the save fails.
            // error is a Parse.Error with an error code and message.
            return ('Failed to create new object, with error code: ' + error.message);
        });
});


// To Run the code in PHP 

$rating = ParseCloud::run("newUser", $userData);


Actual Outcome

Error as explained before

Expected Outcome

fail or success message

Environment

Parse PHP SDK

  • SDK version: 2.3.2
  • PHP version: 8.2.0

Server

  • Parse Server version: 6.2.1
  • Operating system: Ubuntu 20
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Digital Ocean

Database

  • System (MongoDB or Postgres): MongoDb
  • Database version: 6
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local

Logs

A PHP Error was encountered
Severity: Warning

Message: Undefined array key "result"

Filename: Parse/ParseCloud.php

Line Number: 40

Backtrace:

File: /Applications/MAMP/htdocs/scr/application/third_party/parse/vendor/parse/php-sdk/src/Parse/ParseCloud.php
Line: 40
Function: _error_handler

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions