danielbrendel / hortusfox-web

Self-hosted collaborative plant management and tracking system for plant enthusiasts
https://www.hortusfox.com
MIT License
674 stars 34 forks source link

Inventory : ID/Location duplication when editing #285

Closed kaleben0 closed 4 weeks ago

kaleben0 commented 1 month ago

Describe the bug When creating an inventory item, that works fine, but when you go to edit that same item, the ID and Location are automatically added to the fields. Unless you manually remove them, then will be saved again and be duplicated in the database entry.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Inventory'
  2. Click on an item and 'Edit'
  3. Save item
  4. ID # and Location at duplicated in the entry

Expected behavior The field headers should not be automatically added to the field while editing

Screenshots Screenshot 2024-10-18 105556

Software:

Desktop:

Smartphone:

kaleben0 commented 4 weeks ago

Daniel,

The code changes didn't seem to fix the issue, but it pointed me in the right direction.

If you edit these to lines (you probably have better way to do it) it will keep the ID & Location labels from being put in the input fields for Editing Inventory items.

/app/view/inventory.php Line 37
<div class="inventory-item-name" id="inventory-item-name-{{ $inventory->get($i)->get('id') }}"><span><!--#{{ sprintf('%03d', $inventory->get($i)->get('id')) }}</span>--> <a href="javascript:void(0);" onclick="window.vue.expandInventoryItem('inventory-item-body-{{ $inventory->get($i)->get('id') }}');">{{ $inventory->get($i)->get('name') }}</a></div>

/app/lang/en/app.php Line 353 'location_fmt' => '{loc}',

Hope this helps. Thank You!

kaleben0 commented 4 weeks ago

Ah, ok. I see the version release now and that makes more sense. Thanks again!