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

Console warning when setting item rarity to blank #211

Closed
kgar opened this issue Dec 26, 2023 · 1 comment
Closed

Console warning when setting item rarity to blank #211

kgar opened this issue Dec 26, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@kgar
Copy link
Owner

kgar commented Dec 26, 2023

When setting item rarity to blank in the dropdown, the following warning occurs

commons.js:7439 TypeError: Failed data migration for ConsumableData: Cannot read properties of null (reading 'toLowerCase')
    at physical-item.mjs:87:68
    at Array.find (<anonymous>)
    at #migrateRarity (physical-item.mjs:86:58)
    at PhysicalItemTemplate._migrateData (physical-item.mjs:60:40)
    at ConsumableData._migrateData (abstract.mjs:231:16)
    at ConsumableData.migrateData (abstract.mjs:218:10)
    at ConsumableData.migrateDataSafe (commons.js:7436:14)
    at TypeDataField.migrateSource (commons.js:6743:22)
    at SchemaField.migrateSource (commons.js:5514:51)
    at Item5e.migrateData (commons.js:7423:19)

The issue is the Select component is intentionally setting things to null when the current target value is empty string. This was likely by design because of other issues related to null/undefined dropdown options.

First, determine if there would be any problems with simply allowing empty string in the Select saveChanges function. If there are issue, provide then appropriate prop(s) for opting into allowing empty string during save.

@kgar kgar added the bug Something isn't working label Dec 26, 2023
@kgar kgar self-assigned this Feb 10, 2024
@kgar kgar added awaiting-release This is awaiting release and removed awaiting-release This is awaiting release labels Feb 10, 2024
@kgar
Copy link
Owner Author

kgar commented Feb 10, 2024

Closing as completed 💪

@kgar kgar closed this as completed Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant