#2810 - Ability To Configure Which Fields To Search For Duplications On#2882
Conversation
kodinkat
commented
Feb 5, 2026
- fixes: Ability to configure which fields to search for duplicates on. #2810
- Added checks for the existence of Foundation components before initializing the Accordion and MediaQuery functions to prevent potential errors in environments where Foundation is not loaded.
- Improved mobile filter collapse functionality by ensuring Foundation is available before executing related logic.
- Added functionality to configure fields for duplicate detection in the general settings tab.
- Introduced a new form for selecting fields to check for duplicates, ensuring the 'name' field is always included.
- Enhanced JavaScript to manage field selection and submission, utilizing a multi-select component for better user experience.
- Created helper functions to extract field values based on type for duplicate searches.
- Updated site options to store duplicate field configurations, allowing for flexible management of duplicate detection across post types.
- Enhanced the collapse_filters function in modular-list.js for better readability by formatting conditional checks.
- Updated contacts.js to ensure the merge duplicate modal is properly initialized before opening, adding error handling for missing Foundation components and modal instances.
- Enhanced the logic for processing duplicate fields configuration in the general settings tab, ensuring that user-defined settings are respected and defaults are applied when necessary.
- Improved JavaScript to handle form submissions for duplicate fields, including validation and sanitization of input data.
- Updated PHP to clear cache after saving settings, ensuring fresh data is read on subsequent requests.
- Streamlined the extraction of field values for duplicate searches, improving code readability and maintainability.
- Cleaned up whitespace and improved code readability in the duplicate fields configuration functions.
- Enhanced the logic for processing duplicate fields in the admin settings, ensuring proper validation and sanitization of input data.
- Streamlined the handling of default fields for duplicate detection across post types, maintaining user-defined settings while applying defaults where necessary.
- Updated comments for clarity and maintainability throughout the affected files.
…ndentation for better readability.
…ag indentation for enhanced readability.
…r clarity
- Removed redundant mention of the 'name' field in the instructions for configuring duplicate record checks, streamlining the user guidance.
|
@claude review? |
|
I'll analyze this and get back to you. |
|
Hey @kodinkat, Could you look into (or clarify) these 2?
In duplicates-merging.php, the endpoint now calls 2 remove Foundation defensive checks in modular-list.js and |
- Simplified conditional checks for Foundation MediaQuery in the collapse_filters function for better readability.
- Streamlined the initialization of the Foundation Accordion by removing redundant checks, ensuring it is always executed when filter_accordions are present.
- Enhanced the merge duplicate modal opening logic in contacts.js by directly calling the foundation method, improving code clarity and reducing error handling complexity.
…ools-theme into 2810-ability-to-configure-which-fields-to-search-for-duplications-on
- Updated the to remove an unnecessary parameter in the duplicate ID retrieval function for cleaner code.
- Initialized as an associative array in to ensure a consistent structure.
- Enhanced JavaScript in to ensure is always treated as an array, improving robustness and preventing potential errors.
@corsacca good spot re point (1); as this was changed in error. Latest updates pushed and review ready..... |
| 'available_languages' => dt_get_available_languages(), | ||
| 'site_options' => dt_get_option( 'dt_site_options' ), | ||
| 'contacts_field_settings' => DT_Posts::get_post_field_settings( 'contacts' ), | ||
| 'duplicate_fields' => $duplicate_fields_data, |
There was a problem hiding this comment.
@kodinkat the field_settings for all post types could be directly available under dtOptionAPI. Then it can be used by other settings
| // Check if valid config exists for this post type | ||
| let selectedFields; | ||
| if ( | ||
| duplicateFieldsConfig.hasOwnProperty(postType) && |
| * @param string $post_type The post type to get defaults for | ||
| * @return array Array of field keys to check for duplicates | ||
| */ | ||
| if ( !function_exists( 'dt_get_duplicate_fields_defaults' ) ) { |
| dt_theme_enqueue_script( 'web-components', 'dt-assets/build/components/index.js', array(), false ); | ||
| dt_theme_enqueue_style( 'web-components-css', 'dt-assets/build/css/light.min.css', array() ); | ||
|
|
||
| if ( isset( $_GET['tab'] ) && ( ( $_GET['tab'] === 'people-groups' ) || ( $_GET['tab'] === 'general' ) ) ) { |
There was a problem hiding this comment.
this page need to work on /wp-admin/admin.php?page=dt_options as well.

