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

Ensure port validation returns boolean #37

Merged
merged 1 commit into from Dec 15, 2023

Conversation

knolleary
Copy link
Contributor

The port validation on oracle-server wasn't returning a boolean - it was relying on the truthiness of what String.match() returns. Since Node-RED 3.1, if a validator returns an array, that is interpreted as a validation error (with the array containing reason messages). This means the config node is failing validation and it gets flagged as an error in the editor.

This PR ensures the validation returns a boolean.

@vtulluru vtulluru merged commit 1b61b04 into vtulluru:master Dec 15, 2023
vtulluru added a commit that referenced this pull request Jan 3, 2024
On Wed, Jan 3, 2024 at 7:42 AM omrid01 <notifications@github.com> wrote:
Following pull-request #37 by @knolleary, a fix was provided in release v0.6.4, to ensure the port validation function in the config node returns a Boolean value (required by Node-red as of v3.1.x)

I have installed v0.6.4, but the problem persists. Yet, when I patch the source file manually, the issue is resolved. Maybe the fix (which appears in the v0.6.4 release notes), has been omitted from the release?

The manual fix was to edit the file
"\node_modules\node-red-contrib-oracledb-mod\lib\oracledb.html"
and replace
'''return v == null || v.match(/^(\s*|\d+|null)$/);withreturn v == null || !!v.match(/^(\s*|\d+|null)$/);```

I am working on Windows, Node-red v3.1.3, Node-JS v20.10.0, NPM v10.2.3
@vtulluru vtulluru mentioned this pull request Jan 3, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants