Skip to content

Bug: Trade items move to wrong column when editing #36

Description

@Kreuterberg

Bug: Trade items move to wrong column after editing twice

When you edit a trade, save it, and edit it again, all items move to the left
(gain) column - even the ones that should be in the right (loss) column.

Reproduce:

  1. Create trade: 1x Gold (gain), 5x Silver (loss) → Save
  2. Edit → looks correct → Save again
  3. Edit again → All items are now in the gain column

Expected: Items stay in their columns
Actual: Loss items move to gain column after second edit

Root cause:
templates/local/trade/item_table_data_loss.mustache line 22 uses the wrong
template:

{{#lossitems}}
{{>block_stash/trade_add_item_detail}}
{{/lossitems}}

This renders <input name="add_item[]"> instead of <input name="lose_item[]">, so PHP saves everything as gain items.

Fix: Change line 22 to {{>block_stash/trade_loss_item_detail}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions