jopeek / fvtt-loot-sheet-npc-5e

FVTT - Loot Sheet NPC 5E
MIT License
44 stars 86 forks source link

[Not fixed] cannot buy inventory #395

Closed iksior closed 1 year ago

iksior commented 1 year ago

Describe the bug CURRENT VERSION 5.5.

Issue created in version 5.3 retested on 5.4 and 5.5 and it still persist. Link to previous issue: https://github.com/jopeek/fvtt-loot-sheet-npc-5e/issues/393#issue-1621709686

After clicking on buy icon from account with observer account nothing is happenning and error is being displayed in console To Reproduce Steps to reproduce the behavior:

  1. Create new NPC
  2. Change sheet to Loot sheet npc
  3. Add observer permission for a player
  4. add item from inventory to npc inventory
  5. relog to player account
  6. click on npc token
  7. after clicking on BUY icon nothing is happening but error is being displayed in console Uncaught TypeError: undefined. Cannot read properties of null (reading '_id') [Detected 1 package: lootsheet-simple] at LootSheet5eNPC._buyItem (lootsheet-simple.js:628:30) at HTMLAnchorElement.<anonymous> (lootsheet-simple.js:309:47) at HTMLAnchorElement.dispatch (jquery.min.js:2:43064) at y.handle (jquery.min.js:2:41048)

Expected behavior Item should be added to player inv

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

jopeek commented 1 year ago

I’ll have a look but can you try this:

Instead of logging out the GM, open a new browser in private mode and log in as the player. Then try to purchase while the GM is logged in still and on the same scene as the player and the lootsheet token.

Thanks On Mar 20, 2023 at 9:08 AM -0700, iksior @.***>, wrote:

Describe the bug CURRENT VERSION 5.5. Issue created in version 5.3 retested on 5.4 and 5.5 and it still persist. Link to previous issue: #393 (comment) After clicking on buy icon from account with observer account nothing is happenning and error is being displayed in console To Reproduce Steps to reproduce the behavior:

  1. Create new NPC
  2. Change sheet to Loot sheet npc
  3. Add observer permission for a player
  4. add item from inventory to npc inventory
  5. relog to player account
  6. click on npc token
  7. after clicking on BUY icon nothing is happening but error is being displayed in console Uncaught TypeError: undefined. Cannot read properties of null (reading '_id') [Detected 1 package: lootsheet-simple] at LootSheet5eNPC._buyItem (lootsheet-simple.js:628:30) at HTMLAnchorElement. (lootsheet-simple.js:309:47) at HTMLAnchorElement.dispatch (jquery.min.js:2:43064) at y.handle (jquery.min.js:2:41048)

Expected behavior Item should be added to player inv Screenshots If applicable, add screenshots to help explain your problem. Desktop (please complete the following information):

• OS: MacOS • Browser Chrome • Version Version 110.0.5481.177 (Official Build) (arm64)

Additional context Add any other context about the problem here. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

iksior commented 1 year ago

on it

iksior commented 1 year ago

Still the same problem. Is there any way that I can share a yt link in more... Private way with the bug?

jopeek commented 1 year ago

I’ll try to reproduce it tonight and let you know if i can’t. I’ve got the line number so should be easy. What item was it? On Mar 20, 2023 at 9:20 AM -0700, iksior @.***>, wrote:

Still the same problem. Is there any way that I can share a yt link in more... Private way with the bug? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

iksior commented 1 year ago

Sent to your email addr jop..k@..... In fact it doesn't matter which item. I have the same situation for any item.

jopeek commented 1 year ago

Ok thanks! On Mar 20, 2023 at 9:25 AM -0700, iksior @.***>, wrote:

Sent to your email addr @. In fact it doesn't matter which item. I have the same situation for any item. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

jopeek commented 1 year ago

The problem is that your player is not assigned to a character, so the sheet has nowhere to send the purchased item. There was supposed to be a proper error message for that but it was not working. That has been fixed in 5.0.6, but you will still need to assign a character to the player in order to purchase or loot.