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

Allows add-on properties of type undefined to change type #3874

Merged

Conversation

emmebi
Copy link
Collaborator

@emmebi emmebi commented Mar 17, 2023

Allows for an add-on property which got an undefined DataType to be redefined with a different DataType.

Fixes #3819

Requirements for Contributing a Bug Fix or Enhancement

Identify the Bug or Feature request

Fixes #3819

Description of the Change

When we assign a property in an add-on with an empty string, the property gets the UNDEFINED data type; once this happens, it's not possible anymore for the property to change value.

This is because there is an explicit check which controls if we are storing in a property of one type a value which can be converted in that type. No value can be converted into the UNDEFINED value, hence the error.

This change relaxes the check so that the conversion logic is invoked only when there is no property with the same name or the property has UNDEFINED as the DataType of the value stored.

Possible Drawbacks

As this is a change in an existing behavior, it's possible that some add-on could break as a result of this. While I fail to see a reasonable use-case for this behavior, it doesn't mean that such an use-case doesn't exist.

Documentation Notes

Relevant lines

Release Notes

  • Fixed add-on properties becoming unmutable after being assigned the empty string

This change is Reviewable

Once an add-on property gets a type `undefined` it becomes unmutable.
This change allows, only for the properties of type `undefined` to change
type once.
@cwisniew cwisniew merged commit f3883c0 into RPTools:develop Mar 28, 2023
@cwisniew cwisniew added the bug label Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Add-on property becomes broken if set as "" for the first time
3 participants