Note API - Fix joining to and updating Notes
authorColeman Watts <coleman@civicrm.org>
Mon, 27 Feb 2023 15:19:53 +0000 (10:19 -0500)
committerColeman Watts <coleman@civicrm.org>
Mon, 27 Feb 2023 17:10:23 +0000 (12:10 -0500)
commit5b7cc7239ce2ddea5eb883f2dcdd8ad2f761f19c
tree4f19d660ff5b78f91bcb962c5c289d39aefb71da
parent08ac12300d7c471f62ede876d39692c991f781e0
Note API - Fix joining to and updating Notes

Multiple bugfixes:

1. Could not join to Notes from APIv4 because it would "helpfully" insert a contact_id clause in the join
2. Creating a note with no contact_id was defaulting to the contact the note was about rather than the logged-in user
3. Updating a note was clobbering the contact_id and the privacy fields
4. Note ACLs were being applied incorrectly to the Note.contact_id field
CRM/Core/BAO/Note.php
CRM/Core/DAO.php
Civi/Api4/Query/Api4SelectQuery.php
tests/phpunit/api/v3/SyntaxConformanceTest.php
tests/phpunit/api/v4/Entity/NoteTest.php