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

Unable to delete items from gem bag #976

Closed
johncarney opened this issue Dec 30, 2024 · 2 comments
Closed

Unable to delete items from gem bag #976

johncarney opened this issue Dec 30, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@johncarney
Copy link

Gems cannot be deleted from a character's gem bag.

Foundry version12.331
Shadowdark system version3.2.2
Enabled modulesNone

Steps to reproduce

  1. Create a Shadowdark game world. Do not enable any modules.
  2. Create a character
  3. Add one or more items to the character's gem bag
  4. Right-click on an item in the gem bag.
  5. Select "delete item"

At this point I would expect the item to be removed from the gem bag. However nothing happens. In the developer console the following error message appears.

GemBagSD.mjs:134 Uncaught ReferenceError: tr is not defined
    at Object.callback (GemBagSD.mjs:134:21)
    at #onClickItem (foundry.js:68634:11)
    at HTMLElement.dispatch (jquery.min.js:2:40035)
    at v.handle (jquery.min.js:2:38006)

Work around

In order to remove an item from a character's gem bag you can sell it, then manually remove the appropriate number of coins from the character's inventory.

Video

gem-bag-bug.mp4
@johncarney
Copy link
Author

johncarney commented Dec 30, 2024

Looking at the code, I think tr.data is meant to be element.data:

{
    name: game.i18n.localize("SHADOWDARK.sheet.general.item_delete.title"),
    icon: '<i class="fas fa-trash"></i>',
    condition: element => canEdit(element),
    callback: element => {
        const itemId = tr.data("item-id");
        this._onItemDelete(itemId);
    },
},

@Muttley Muttley self-assigned this Dec 30, 2024
@Muttley Muttley added the bug Something isn't working label Dec 30, 2024
@Muttley Muttley added this to the release-3.3.0 milestone Dec 30, 2024
@Muttley Muttley changed the title Bug: Unable to delete items from gem bag Unable to delete items from gem bag Dec 30, 2024
@Muttley
Copy link
Owner

Muttley commented Dec 30, 2024

Many thanks for the thorough bug report. This will be fixed in the next release.

Muttley added a commit that referenced this issue Dec 30, 2024
@Muttley Muttley closed this as completed Jan 2, 2025
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

2 participants