Skip to content

Conversation

@barvaliyarajnil
Copy link

Description

Not working is we enabled full null support.

IMPORTANT: Please review the CONTRIBUTING.md file for detailed contributing guidelines.

Issues

All PRs must have an accompanied issue. Please make sure you created it and linked it here.

Type of change

Please delete options that are not relevant.

  • Bug Fix
  • Improvement

Copy link
Author

@barvaliyarajnil barvaliyarajnil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not working if enbaled full null support

param arguments.dateMask = thisMemento.dateMask;
param arguments.timeMask = thisMemento.timeMask;
param arguments.autoCastBooleans = thisMemento.autoCastBooleans;
if(isNull(arguments.trustedGetters)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the param is not respecting full null support?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you use param inside a function, I mean generally we use param for form and URL data.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

param is a generic language construct that tests for a parameter's existence, tests its data type, and, if
a default value is not assigned, optionally provides one. A parameter can be any valid scope variable. Thus, it can be used not only for the form/url scopes, but for any scope. That's why it should test If the paramed variable is null and assign it the default value.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we enable full null support and pass any one argument then remain argument is initiated with a null value and not set a default value, Because we define it in function, the param works fine for undefined variables/arguments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please let me know how I can reproduce this please.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reproduction first enabled full null support in an application using this.nullSupport = true;
Then just call getMemento for any object with ignoreDefaults: true
i.e. userBean.getMemento( includes: "name", excludes:"id",ignoreDefaults: true);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What CFML Engine are you using?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using Lucee 5.3.9.141

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. let me go and test.

@lmajano
Copy link
Contributor

lmajano commented Sep 18, 2023

Sorry on the delay. Tested and verified. Had to do more tuning around this, but it's now on be. Thanks for the PR

@lmajano lmajano closed this Sep 18, 2023
@lmajano lmajano mentioned this pull request Sep 18, 2023
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.

2 participants