-
Notifications
You must be signed in to change notification settings - Fork 6
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
Set m_OriginalMethod to null when selecting a type #285
Set m_OriginalMethod to null when selecting a type #285
Conversation
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.
Tested Excel and this resolves the issue raised there.
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 have no problem with this change as it doesn't break anything for any UI.
Based on @rwemay confirming that it fixes the problem in Excel, I am happy to approve.
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.
This solves the issue for me in Excel.
This change does not cause any issue for me in Grasshopper. Have not tested Dynamo.
Seems to be fine with Dynamo too. |
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.
Testing in Grasshopper and Excel - also working for me
/azp run BHoM_UI.CheckInstaller |
Azure Pipelines successfully started running 1 pipeline(s). |
Issues addressed by this PR
Closes #284
as stated in issue:
When
SetItem
is called for the general case that a method is being picked,m_OriginalMethod
is being handled and set to the corresponding method or nulled out if not used in theSetItem
on the method called.On the CreateCaller on the other hand, when a type is selected,
m_OriginalMethod
is not touched.For Grasshopper and dynamo this is not an issue, as they have a one-to-one relation between a component and one caller. For excel on the other hand this becomes an issue, as Excel_UI only owns one of each caller type, which is being used for all the calls that goes through that particular caller.
This means that if a create method is called, followed by a property assignment method, basically method followed by type,
m_OriginalMethod
is still set to the method.This in turn causes issues with the serialisation of the component, as selected item prioritises
m_OriginalMethod
overSelectedItem
when turned to JSON.Test files
This is all happening on adding methods, hence no test file can be provided. In Excel: Try Creating an object with a create method, then creating an obejct with a property initialiser. Then either look at how the methods have been stored, and/or save and reopen the sheet.
Alsno need to make sure this does not cause any issues elsewhere in the other UIs.
Changelog
Additional comments