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

deployrInput ignores existing variable value if the variable name happens to be "x" #12

Open
warmdev opened this issue Sep 8, 2015 · 2 comments

Comments

@warmdev
Copy link

warmdev commented Sep 8, 2015

Symptom: deployrInput ignores existing variable value (and thus API input) if the input variable name happens to be x.

Cause: line 104 reads the existing variable value using x <- get(name), but if name happens to be "x", then this line would actually read the x value assigned in line 96 (i.e. the default value).

Possible solution: default value should only be used when the variable value is not provided by input.

    if (!is.null(name) && exists(name)) {
        x <- get(name)  
    } else {
        if (!is.null(default)) {
            x <- default
        }
    }
@warmdev
Copy link
Author

warmdev commented Sep 9, 2015

In fact, input variable name should not be any of the variable names defined inside deployrInput source code. Here is a blacklist of variable names which should not be used in deployrInput declarations: name, default, render, label, min, max, levels, labels, n, JSONResult and x.

@swells
Copy link
Member

swells commented Sep 9, 2015

Thanks,

In fact, input variable name should not be any of the variable names
defined inside deployrInput source code

Good point, I was thinking the same thing after your last message.

I will see if we can get this in time to be bundled with the new DeployR
server push we will be doing in the coming days which is the first
priority.

  • Sean

On Tue, Sep 8, 2015 at 6:10 PM, warmdev notifications@github.com wrote:

In fact, input variable name should not be any of the variable names
defined inside deployrInput source code. Here is a blacklist of variable
names which should not be used in deployrInput declarations: name, default,
render, label, min, max, levels, labels, n, JSONResult and x.


Reply to this email directly or view it on GitHub
#12 (comment)
.

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

No branches or pull requests

2 participants