You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
API Update and Create, option to not overwrite existing values (#2668)
* Support new dt-import non-overwrite setting
* Include overwrite logic within post update flows with supporting unit tests
* Additional field type unit tests
* Ensure unit test users are created accordingly
* Introduce base_user
* Rolled out base_user reference
* moved function location
* Fix field value comparison logic and improve option matching in Disciple_Tools_Posts class
* Tweaked overwrite logic and unit test adjustments
* delete extra filter
* Updated dt_ignore_duplicated_post_fields logic and unit tests following revised requirements
* Refactor unit tests to validate milestone handling and ensure user select fields are not overwritten during post creation
* Enhance post handling by adding support for user_select, link, and connection fields; update unit tests to ensure fields are not overwritten during creation and updates
* Addressed user does not have access to contacts unit test exceptions
* revert Update install-wp-tests.sh
* Fix endpoint parameter
* use isset to check for value
* Revert isset check, update on number fields
* Fix duplicate detection for communication_channel fields with wrapped format
The dt_ignore_duplicated_post_fields function now correctly handles both direct array format [['value' => 'xxx']] and wrapped format ['values' => [['value' => 'xxx']]] for communication_channel fields.
- Added logic to detect if field_value has a 'values' key and extract the correct array to iterate over
- Preserves the original format (wrapped or direct) when returning updated fields
- Fixes bug where wrapped format was not being processed correctly, leading to incorrect duplicate detection
This ensures that duplicate detection works consistently regardless of the field format received.
* location and boolean fields
* fixed the deprecated str_getcsv() function calls
* Standardize field format handling: Always return wrapped format
All multi-value field types (tags, link, connection, multi_select, location, location_meta, communication_channel) now consistently:
- Accept both direct array format [['value' => 'xxx']] and wrapped format ['values' => [['value' => 'xxx']]]
- Always return wrapped format ['values' => ] for consistency
This ensures uniform behavior across all field types and eliminates format inconsistencies that could cause issues when fields are provided in different formats.
* Update unit tests to standardize contact_phone and contact_email field formats
Modified the unit tests for create and update post functionalities to use the new wrapped format for contact_phone and contact_email fields. This change ensures consistency with the recent updates to field handling across the codebase.
---------
Co-authored-by: corsac <corsacca@gmail.com>
0 commit comments