-
Notifications
You must be signed in to change notification settings - Fork 23
fix: Resolve <UNDEFINED> error in 'generate' command WebApp processing #970
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
base: main
Are you sure you want to change the base?
fix: Resolve <UNDEFINED> error in 'generate' command WebApp processing #970
Conversation
isc-kiyer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AshokThangavel The fix looks good to me! Please add a corresponding changelog entry and then I will approve
|
Great, thank you for the review. I’ve added the corresponding changelog entry. |
| set tPath = props("Path") | ||
| }else{ | ||
| set tAppName = $listget(tAppList,i) | ||
| set tAutheEnabled = 64 //Unauthenticated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we must have a default, I'd prefer 32 (password) over 64 (unauthenticated) - also consider using macros from %sySecurity.inc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(e.g., $$$AuthePassword)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Fixed: I've applied the fix, updating the default authentication preference (32 over 64) and converting the values to use system macros.
| set ..TemplateResources(tAppName,"PasswordAuthEnabled") = 1 | ||
| } elseif ( props("AutheEnabled") = 64 ) { | ||
| } elseif ( tAutheEnabled = 64 ) { | ||
| set ..TemplateResources(tAppName,"UnauthenticatedEnabled") = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth fixing this typo while we're at it - if tAutheEnabled = 64 we should set UnauthenticatedEnabled, not PasswordAuthEnabled!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!. I've corrected the logic.
|
|
||
| new $namespace | ||
| set $namespace = "%SYS" | ||
| set (tMatchRoles,tDispatchClass,tAutheEnabled,tPath)="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: for net new code, we do not use t-prefixes. So these should be defined as matchRoles, dispatchClass, etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the t prefix from variable names.
Thanks!
| set tAutheEnabled = props("AutheEnabled") | ||
| set tDispatchClass = props("DispatchClass") | ||
| set tPath = props("Path") | ||
| }else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: conventionally there should be a space before and after else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve fixed the spacing around else to follow the convention.
|
|
||
| Method TestFixUndefinedCLIGenCommand() | ||
| { | ||
| set tWebAppList = "/test/test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: more t prefixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the t prefix from variable names.
Fix: Resolve
<UNDEFINED>Error ingenerateWebApp ProcessingFixes #969
This Pull Request addresses a bug in the
generatecommand that caused the command to fail when a user attempted to specify a web application path during module creation.📝 Bug Summary
The
generatecommand, which relies on the%IPM.Storage.ModuleTemplateclass to process configuration, failed with an<UNDEFINED>error when the user provided input for the prompt. The error prevented the module template from being successfully created whenever web application properties were involved.Original Error Trace:
🛠️ Key Fix
The issue was traced to the
AddWebAppsmethod within%IPM.Storage.ModuleTemplate. The fix involves ensuring that all required properties within the method are correctly defined and initialized before any attempt is made to access or process them.The code is now robust against missing or improperly structured input variables during the web app configuration phase.
🧪 Unit Test Verification
The bug fix was validated using a targeted unit test that directly called the failing method with the problematic input.
This confirms that the
AddWebAppsmethod now processes the web application list correctly and returns an OK status, resolving the<UNDEFINED>error in isolation.