Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.38k stars 2.77k forks source link

Attached files and documents in products #22920

Open jasch0825 opened 1 year ago

jasch0825 commented 1 year ago

Bug

If you add more as 9 image to a product under linked files, then you can't sort the attached files any more, like you wanted.

Environment Version

16.0.2

Environment OS

Linux

Environment Web server

Apache

Environment PHP

7.4

Environment Database

Mysql

Environment URL(s)

No response

Expected and actual behavior

No response

Steps to reproduce the behavior

By more as 9 image, the sorting function is not working proper any more.

Attached files

No response

priojk commented 1 year ago

I did not verify the problem myself. However, it sounds like the position of the files could be a number, which is sorted as a string. This would mean a sorting order of 1, 10, 2, 3 ... 9 instead of 1, ..., 10. Could you check, if the tenth element always ends up in position 2? Or is not sorting possible at all?

jasch0825 commented 1 year ago

I checked again and made some pictures:

Web capture_23-11-2022_94529_tecsit de Product with 10 pictures

Web capture_23-11-2022_94846_tecsit de Result after moving position 1 to 2 and reload the page

Web capture_23-11-2022_95225_tecsit de Result after moving position 1 to 2 and reload the page again

Just let me know if you need more information.

priojk commented 1 year ago

I think your screenshots confirm my reasoning. On the second screenshot, the last two images presumably have the index 10 and 11. After the movement and reload, they get to the first positions, then following the image with index 2 and so on, so the sorting goes 10, 11, 2, 3, ..., meaning it is alphabetically sorted as strings and not as numbers. We see the same behaviour also with account numbers, where this happens as well.

In the case of product image positions, this indeed seems to be a bug.

ksar-ksar commented 1 year ago

Hello,

It is still the case with V18 ?

github-actions[bot] commented 4 days ago

This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 10 days (you should still be able to re-open it if required).