Target ID is shifted by one while generating part lot labels with twig
Describe the bug hello,
i think i found a bug where incorrect part is being referenced while using twig while referencing part from part lot. output parts are being shifted by one. example:
range 10-14 will be give parts for 9,10,11,12,13 10,15,17 will give parts for 9,14,16 10 will give part with ID 9
issue only exists only when referencing part from part lot with twig as {{ element.part.id }} if i switch label generator to part and try the same thing with {{ element.id }} correct values are being returned.
problem is not only with ID field but all fields. ID, Name, Comment etc. so i suspect that if using element.part wrong object is being referenced.
To Reproduce Steps to reproduce the behavior:
- go to Tools --> Label generator --> advanced tab--> check twig mode (to select that it's required to enable it in permissions options)
- go to "common tab"
- change Target type to Part Lot
- provide some target ID
- type
{{ element.part.id }}in content field - click update
Expected behavior expected behavior is to receive ID of a part that this part lot is part of.
Screenshots
Server Side
- Part-DB Version: 1.14.2
- PHP Version: 8.2.24 (SAPI: fpm-fcgi)
- Database Server SQLite 3.40.1
Desktop (please complete the following information):
- OS: Microsoft Windows 11 Pro, 10.0.22631 N/A Build 22631
- Browser Firefox
- Version 131.0.3 (64-bit)
Smartphone (please complete the following information): N/A
Additional context N/A
Thank you. have nice day! 😄