diff --git a/CHANGES.md b/CHANGES.md index 04bbdc5..015791c 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,6 @@ +1.0.2 +- [0] Check to see if the SAAS Ticket ID field exists before creating it. Future versions of Awesome support will define this field so no need to define it here if it already exists. + # 0.2.2 / 1.0.1 - [49] Don't load unless Awesome Support is loaded. diff --git a/awesome-support-importer.php b/awesome-support-importer.php index a674432..a448a75 100755 --- a/awesome-support-importer.php +++ b/awesome-support-importer.php @@ -10,8 +10,8 @@ * Plugin Name: Awesome Support: Importer * Plugin URI: TODO: URL to the final build. * Description: Allows users to import tickets from a variety of help desks into Awesome Support. - * Version: 1.0.1 - * Author: Pressware, LLC + * Version: 1.0.2 + * Author: Pressware, LLC for Awesome Support * Author URI: https://pressware.co * Text Domain: awesome-support-importer * License: GPL-2.0+ diff --git a/src/Plugin.php b/src/Plugin.php index 6f9cf9b..cb7d7d3 100755 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -151,6 +151,11 @@ protected function addCustomFields() if (!function_exists('wpas_add_custom_field')) { return; } + + /* Does the field already exist? */ + if ( isset( WPAS()->custom_fields->get_custom_fields()[ 'help_desk_ticket_id' ] ) ) { + return ; + } // Note: Awesome Support automatically adds a `_wpas_` prefix to this custom field name. wpas_add_custom_field('help_desk_ticket_id', [