Fix (sometimes serious) performance problem on submitting profiles for specified...
authoreileen <emcnaughton@wikimedia.org>
Fri, 15 Feb 2019 04:00:54 +0000 (17:00 +1300)
committereileen <emcnaughton@wikimedia.org>
Fri, 15 Feb 2019 04:10:24 +0000 (17:10 +1300)
commit7c06861a52f6b075c9b9063cb88d2e83475ffc02
treef9a77a209028a56e247630d6d46b217a1088b39b
parent60f635a4d22cd891b9a8b4c1f8046634ad278ef7
Fix (sometimes serious) performance problem on submitting profiles for specified contacts.

->_id is set when the contact id is known - e.g in edit, in contactlayouteditor profile
blocks. However, current logic still retrieves duplicates and then... does nothing
with them if ->_id is set. By moving the if up higher we can save the server from
doing unnecesary queries. Note that if you submit a tag profile with no other fields in it
the query is server-destroyingly bad with this
CRM/Profile/Form.php