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

Logic Tab autosaves incorrect "setValue" after loading page fix #5083 #5091

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

andrewtelnov
Copy link
Member

No description provided.

@@ -105,6 +105,8 @@ export class SurveyLogicType {
if ((<any>obj).setOwner) {
(<any>obj).setOwner(this.survey);
}
//Do not fire notification about changes to our creator.survey model
obj["isGhost"] = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

is it secure for our code?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we have isGhost property from ItemValue and Triggers.
We can move it to Base class. I am not sure we need it.

Thank you,
Andrew

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like hack. I am affraid that somebody can add isGhost for any other object type in future... If we want to keep isGhost only in ItemValue and Trigger maybe it could be better if we add condition for this setting, something like...?

if(obj instance of ItemValue || obj instanceof Trigger) {
  obj["isGhost"] = true;
}

It still will be the hack, but more secure...

@novikov82 novikov82 merged commit c2658b2 into master Jan 22, 2024
15 checks passed
@novikov82 novikov82 deleted the bug/5083-logic-tab-triggers branch January 22, 2024 09:13
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