Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket module - Condition validation is wrong #32145

Closed
juaniyofm opened this issue Nov 29, 2024 · 2 comments
Closed

Ticket module - Condition validation is wrong #32145

juaniyofm opened this issue Nov 29, 2024 · 2 comments
Assignees
Labels
Bug This is a bug (something does not work as expected) Event: DevCamp 2024 Munich

Comments

@juaniyofm
Copy link

juaniyofm commented Nov 29, 2024

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

@juaniyofm juaniyofm added the Bug This is a bug (something does not work as expected) label Nov 29, 2024
@priojk priojk self-assigned this Nov 30, 2024
@priojk
Copy link
Contributor

priojk commented Nov 30, 2024

can confirm this behaviour also for v19

priojk added a commit to priojk/dolibarr that referenced this issue Nov 30, 2024
Parameter is always "1" or "0"
@eldy eldy closed this as completed in 53f566e Dec 2, 2024
@juaniyofm
Copy link
Author

Yes, it happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected) Event: DevCamp 2024 Munich
Projects
None yet
Development

No branches or pull requests

2 participants