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

FIX: All contacts were loaded even if no thirdparty was selected #31877

Merged

Conversation

noec764
Copy link
Contributor

@noec764 noec764 commented Nov 15, 2024

This bug is only problematic with a huge amount of contacts.

It only append on an existing actioncomm with no contact or thirdparty attributed. When the user chose to modify it, all the contacts were loaded into the contact selector, resulting in a very slow-loading or even broken page.

I decided to do as it is now on actioncomm creation: the thirdparty needs to be selected before contact.

This behavior can be deactivated with conf MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT

if ($searchSocid <= 0 && getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT')) {
$searchSocid = 0;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have redondancy with your multiple if statements, you can simplify with

$searchSocid = ($object->socid > 0) ? $object->socid : (getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? 0 : -1);

@eldy eldy merged commit a960be4 into Dolibarr:19.0 Nov 16, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants