Duplicating maintenance from global Maintenance page fails because itemId is undefined
First Check
- This is not a feature request
- I added a very descriptive title to this issue.
- I used the GitHub search to find a similar issue and didn't find it.
- I searched the documentation, with the integrated search.
- I already read the docs and didn't find an answer.
- I can replicate the issue inside the Demo install.
Homebox Version
v0.26.2 (commit e01dd737238a3fa7e1a6454b37de6c6fc88c86e4)
What is the issue you are experiencing?
Duplicating a maintenance entry from the global Maintenance page fails with the toast "Failed to create entry." Duplicating the same entry from the individual item's Maintenance tab succeeds.
Expected behavior
The global Maintenance page should duplicate the entry for the item shown on that entry's card.
Actual behavior
The create request fails because the duplicate dialog does not receive a valid item ID.
Confirmed source-level cause
In frontend/components/Maintenance/ListView.vue, the global list retrieves MaintenanceEntryWithDetails records and uses e.itemID for the item's link. However, the Duplicate button passes:
params: { type: "duplicate", maintenanceEntry: e, itemId: props.currentItemId! }On the global Maintenance page, props.currentItemId is undefined. The non-null assertion only affects TypeScript and does not supply a runtime value. EditModal.vue then assigns entry.itemIds = [params.itemId] and attempts to create maintenance for an undefined item ID.
This explains why duplication works from an individual item's Maintenance tab: that view supplies currentItemId.
Suggested fix
Use the ID included with the global maintenance entry when currentItemId is absent:
itemId: props.currentItemId ?? (e as MaintenanceEntryWithDetails).itemIDThe same faulty line is present in both the v0.26.2 tag and the current main branch.
Demo verification
Reproduced on the public demo instance, which reports the same v0.26.2 build: duplication from an individual item succeeds, while submitting the duplicate dialog from the global Maintenance page does not create another entry.
How can the maintainer reproduce the issue?
- Open the global Maintenance page.
- Click Duplicate on any maintenance entry.
- Enter a scheduled date if needed and submit.
- Observe the "Failed to create entry" toast.
- Open the maintenance entry's associated item.
- Go to the item's Maintenance tab and duplicate the same entry.
- Observe that duplication succeeds.
Deployment
Docker (Synology)
Database Type
SQLite
OS Architechture
x86_64 (AMD, Intel)
Deployment Details
Docker deployment on a Synology NAS. HomeBox reports v0.26.2. The failure is in the shared frontend component and is independent of the database contents.
Source: sysadminsmedia/homebox