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.52k stars 2.81k forks source link

Ticket module - Condition validation is wrong #32145

Open juaniyofm opened 2 days ago

juaniyofm commented 2 days ago

Bug

In the ticket/card.php file there is a condition that is evaluated incorrectly because the "private_message" parameter is compared to an unexpected value.

if ($action == 'add_message' && GETPOSTISSET('btn_add_message') && $permissiontoread) { $ret = $object->newMessage($user, $action, (GETPOST('private_message', 'alpha') == "on" ? 1 : 0), 0);

GETPOST('private_message', 'alpha') is always "1" or "0", never is "on"

This violates the scenario that if a comment is marked private, the status should not change.

Dolibarr Version

20.0.2

Environment PHP

8.0

Environment Database

MySQL

Steps to reproduce the behavior and expected behavior

Behavior Add a new message in ticket card and mark it as private. The status changes to "IN PROGRESS"

Expected

The status does not change. The same state is maintained.

Attached files

No response

priojk commented 1 day ago

can confirm this behaviour also for v19