Fix Object encoded as id in dictionaries to be represented as int in the inspector. #94610
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #92533
So I add some time to check this morning and here is the full explanation of what is happening. First getting the value is something hard on a Dictionary since you have values but also two new values and in addition we wish to add keys wich would even more complicate the thing. So Instead of having two places that would do the logic I put in one place. This is the difference with Array.
Now for why this make it fails. This linked to the code @KoBeWi pointed to. This piece of code seems to be needed as
EditorPropertyObjectID
seems to need anint
and not anObject
. Keeping it will make dictionnary handle it as an int and removing it will cause inconsistency as Kobewi showed but also more hard errors such as this one when clicking to edit the button.Hence we need to separate the two while keeping it as coupled as possible (for easier maintenance and easier addition of key editing) this is why I created a new function keeping it without the bit of code that causes problem and
_get
just calls the new function and then do the code that is needed only there.An alternative solution would be to outright remove the problematic code and just make
EditorPropertyObjectID
handleObject
directly instead ofint
. This seems like a cleaner solution and what I would have preferred to be done but this has more potential to have unexpected consequences which wouldn't be possible for 4.3.