fantasycalendar / FoundryVTT-ItemPiles

Other
33 stars 54 forks source link

[BUG] - [PF2E] - Unable to Edit Merchant Columns #568

Closed Ponnosaurus closed 4 months ago

Ponnosaurus commented 5 months ago

Are you on the latest version of Item Piles? Yes

Have you tried to reset Item Piles' system settings? Yes

Describe the bug Clicking "Save" and then "Update Item Pile" in the Merchant Columns in Merchant Item Piles causes all the descriptive columns (including those preset by the module) to be wiped, leaving only "Quantity" and "Price".

To Reproduce Steps to reproduce the behavior:

  1. Create new Item Pile.
  2. Set as Merchant.
  3. Drag and drop actor onto canvas.
  4. Drag and drop any item (I used a Rapier) onto the actor to add into its inventory.
  5. Go to "Configure Pile" --> "Other Settings"
  6. Go to "Configure Merchant Columns" and don't edit anything.
  7. "Save" --> "Update Item Pile"
  8. "Rarity" and "Bulk" columns should be absent immediately upon closing and reopening Item Pile.

Expected behavior Saving changes to Merchant Columns should not be wiping the preset columns or any custom columns.

Screenshots Before accessing Column settings. image

After saving Column settings without any changes. image

Setup:

Active modules:

Additional context Add any other context about the problem here.

Zarhog commented 4 months ago

this also happened to us. wasp said he is aware

OlavStornes commented 4 months ago

A workaround I've found that works is to change a line in the installed module. On line 65437 in {foundry_data_folder}/modules/item-piles/module.js, change the line from:

pileData.merchantColumns = Array.isArray(result.merchantColumns) ? result.merchantColumns : [],

to: pileData.merchantColumns = Array.isArray(result) ? result : [],

I have sent a suggestion to change this in the source as well.

Drag0nF commented 4 months ago

Having the same issue in dnd5e