Skip to content

Commit

Permalink
Check to see if the SAAS Ticket ID field exists before creating it. F…
Browse files Browse the repository at this point in the history
…uture versions of Awesome support will define this field so no need to define it here if it already exists.
  • Loading branch information
elindydotcom committed Dec 1, 2017
1 parent 5da011e commit 7e4a199
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions awesome-support-importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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+
Expand Down
5 changes: 5 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down

0 comments on commit 7e4a199

Please sign in to comment.