Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript Server Side Functions 'null' [Feature Request] #4948

Closed
MVdev1 opened this issue Sep 9, 2015 · 2 comments
Closed

JavaScript Server Side Functions 'null' [Feature Request] #4948

MVdev1 opened this issue Sep 9, 2015 · 2 comments
Assignees

Comments

@MVdev1
Copy link

MVdev1 commented Sep 9, 2015

Calling server side javascript functions supplies a string with the letters "null" when the parameter is left blank.

Ideally, you'd have an empty string or a null in the variable you get in your server side javascript environment but for now I am testing for a string with the letters n-u-l-l.

REPRO:

  1. Create a new javascript server side function with at least 1 parameter (using studio) - let's call it x.
  2. Click execute without filling in any parameters

Notice that x will be "null" on the server.

You can return {aaa: x} to see the results or add code like this...

if (x == null) return {"a":"null string"}; << Expect this
if (x == "null") return {"b":"string with n-u-l-l"}; <<<<<<< Get this.
if (x.length == 0) return {"c":"empty string"}; << Could live with this
return {"d": x};

Results:

[
{
"@type": "d",
"@Version": 0,
"b": "string with n-u-l-l"
}
]

@lvca lvca self-assigned this Sep 18, 2015
@lvca lvca added the bug label Sep 18, 2015
@lvca lvca added this to the 2.1.x (next hotfix) milestone Sep 18, 2015
@lvca lvca assigned luigidellaquila and unassigned lvca Feb 18, 2017
@luigidellaquila
Copy link
Member

Hi @MVdev1

If I didn't get it wrong, this issue is related to:

  • the Function panel in Studio: this cannot be fixed, because the parameters are a simple HTML form, you cannot set a non-string value there
  • HTTP API: in this case I really don't know how to support it, a URL is just a string, I cannot set a null value (and "null" is a valid string...)

Any suggestion is welcome

Thanks

Luigi

@wolf4ood
Copy link
Member

This issue will be fixed once
orientechnologies/orientdb-studio#445
is implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants