New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fieldmap screen design updates #339
base: master
Are you sure you want to change the base?
Conversation
…ieldmap object for the default wordpress object status
…ect_default_status when interacting with the fieldmap database table itself
…e admin ui for fieldmaps. this is not yet running client side.
…the plugin though.
…jects. this way it will work on new fieldmaps and when the field changes.
…should only do it once.
… value around. if it is not overridden by a mapped parameter or a developer hook, and the object type supports a status field, use that default value as the status.
…side the fieldmap selector. we'll need more changes here, including ajax.
…, but it's in the right direction
# Conflicts: # assets/css/object-sync-for-salesforce-admin.css # assets/js/object-sync-for-salesforce-admin.js # assets/js/object-sync-for-salesforce-admin.min.js # assets/js/src/admin.js # assets/sass/object-sync-for-salesforce-admin.scss # package-lock.json # package.json # templates/admin/fieldmaps-add-edit-clone.php
…, descriptive text styles, and show/hide stuff for the server side templates the js uses
…ter all, but expand it instead. use it to get status information for the object.
…shes creating new database fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phpcs scanning turned up:
🚫 7 errors
hashes-api-scanning skipped
@@ -366,31 +373,27 @@ public function get_fieldmaps( $id = null, $conditions = array(), $reset = false | |||
} else { | |||
$where = ''; | |||
} | |||
|
|||
$mappings = $this->wpdb->get_results( 'SELECT * FROM ' . $table . $where . ' ORDER BY `weight`', ARRAY_A ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Use placeholders and $wpdb->prepare(); found $table (WordPress.DB.PreparedSQL.NotPrepared).
@@ -366,31 +373,27 @@ public function get_fieldmaps( $id = null, $conditions = array(), $reset = false | |||
} else { | |||
$where = ''; | |||
} | |||
|
|||
$mappings = $this->wpdb->get_results( 'SELECT * FROM ' . $table . $where . ' ORDER BY `weight`', ARRAY_A ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Use placeholders and $wpdb->prepare(); found $where (WordPress.DB.PreparedSQL.NotPrepared).
if ( version_compare( $this->version, '1.5.0', '>=' ) ) { | ||
if ( version_compare( $this->user_installed_version, '2.1.0', '>=' ) ) { | ||
// if the version is greater than or equal to 2.1.0, the fieldmap table has a wordpress_object_default_status column. | ||
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `wordpress_object_default_status`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `pull_to_drafts`, `weight`, `version` FROM $table", ARRAY_A ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Use placeholders and $wpdb->prepare(); found interpolated variable $table at "SELECT id
, label
, wordpress_object
, wordpress_object_default_status
, salesforce_object
, salesforce_record_types_allowed
, salesforce_record_type_default
, fields
, pull_trigger_field
, sync_triggers
, push_async
, push_drafts
, pull_to_drafts
, weight
, version
FROM $table" (WordPress.DB.PreparedSQL.InterpolatedNotPrepared).
// if the version is greater than or equal to 2.1.0, the fieldmap table has a wordpress_object_default_status column. | ||
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `wordpress_object_default_status`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `pull_to_drafts`, `weight`, `version` FROM $table", ARRAY_A ); | ||
} elseif ( version_compare( $this->user_installed_version, '1.5.0', '>=' ) ) { | ||
// if the version is greater than or equal to 1.5.0, the fieldmap table has a pull_to_drafts column. | ||
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `pull_to_drafts`, `weight`, `version` FROM $table", ARRAY_A ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Use placeholders and $wpdb->prepare(); found interpolated variable $table at "SELECT id
, label
, wordpress_object
, salesforce_object
, salesforce_record_types_allowed
, salesforce_record_type_default
, fields
, pull_trigger_field
, sync_triggers
, push_async
, push_drafts
, pull_to_drafts
, weight
, version
FROM $table" (WordPress.DB.PreparedSQL.InterpolatedNotPrepared).
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `pull_to_drafts`, `weight`, `version` FROM $table", ARRAY_A ); | ||
} elseif ( version_compare( $this->version, '1.2.5', '>=' ) ) { | ||
} elseif ( version_compare( $this->user_installed_version, '1.2.5', '>=' ) ) { | ||
// if the version is greater than or equal to 1.2.5, the fieldmap table has a version column. | ||
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `weight`, `version` FROM $table", ARRAY_A ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Use placeholders and $wpdb->prepare(); found interpolated variable $table at "SELECT id
, label
, wordpress_object
, salesforce_object
, salesforce_record_types_allowed
, salesforce_record_type_default
, fields
, pull_trigger_field
, sync_triggers
, push_async
, push_drafts
, weight
, version
FROM $table" (WordPress.DB.PreparedSQL.InterpolatedNotPrepared).
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `pull_to_drafts`, `weight`, `version` FROM $table", ARRAY_A ); | ||
} elseif ( version_compare( $this->version, '1.2.5', '>=' ) ) { | ||
} elseif ( version_compare( $this->user_installed_version, '1.2.5', '>=' ) ) { | ||
// if the version is greater than or equal to 1.2.5, the fieldmap table has a version column. | ||
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `weight`, `version` FROM $table", ARRAY_A ); | ||
} else { | ||
$mappings = $this->wpdb->get_results( "SELECT `id`, `label`, `wordpress_object`, `salesforce_object`, `salesforce_record_types_allowed`, `salesforce_record_type_default`, `fields`, `pull_trigger_field`, `sync_triggers`, `push_async`, `push_drafts`, `weight` FROM $table", ARRAY_A ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Use placeholders and $wpdb->prepare(); found interpolated variable $table at "SELECT id
, label
, wordpress_object
, salesforce_object
, salesforce_record_types_allowed
, salesforce_record_type_default
, fields
, pull_trigger_field
, sync_triggers
, push_async
, push_drafts
, weight
FROM $table" (WordPress.DB.PreparedSQL.InterpolatedNotPrepared).
@@ -1577,7 +1577,17 @@ private function create_called_from_salesforce( $sf_sync_trigger, $synced_object | |||
// we can then check to see if it has a mapping object | |||
// we should only do this if the above hook didn't already set the $wordpress_id. | |||
if ( null === $wordpress_id ) { | |||
$wordpress_id = $this->wordpress->object_upsert( $salesforce_mapping['wordpress_object'], $upsert_key, $upsert_value, $upsert_methods, $params, $salesforce_mapping['pull_to_drafts'], true ); | |||
// we don't need to check the plugin version here because the default status is empty in the mapping class, if there's no value in the database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phpcs scanning turned up:
hashes-api-scanning skipped
|
||
<!-- this needs to reproduce the loaded version --> | ||
<ul class="sfwp-a-fieldmap-values sfwp-a-fieldmap-values-template" data-key="0"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Conflicts: # assets/css/object-sync-for-salesforce-admin.css # assets/js/object-sync-for-salesforce-admin.js # assets/js/object-sync-for-salesforce-admin.min.js # assets/sass/object-sync-for-salesforce-admin.scss # classes/class-object-sync-sf-admin.php # classes/class-object-sync-sf-mapping.php # classes/class-object-sync-sf-salesforce-pull.php # languages/object-sync-for-salesforce.pot # package-lock.json # templates/admin/fieldmaps-add-edit-clone.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phpcs scanning turned up:
🚫 184 errors
hashes-api-scanning skipped
Posting will continue in further review(s)
<?php | ||
// translators: the placeholders refer to: 1) the cache clear link, 2) the cache clear link text. | ||
echo sprintf( | ||
esc_html__( 'To map a custom meta field (such as post meta, user meta, term meta, etc.), WordPress must have at least one value for that field. If you add a new meta field and want to map it, make sure to add a value for it and ', 'object-sync-for-salesforce' ) . '<a href="%1$s" id="clear-sfwp-cache">%2$s</a>' . esc_html__( ' to see the field listed here.', 'object-sync-for-salesforce' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
// translators: the placeholders refer to: 1) the cache clear link, 2) the cache clear link text. | ||
echo sprintf( | ||
esc_html__( 'To map a custom meta field (such as post meta, user meta, term meta, etc.), WordPress must have at least one value for that field. If you add a new meta field and want to map it, make sure to add a value for it and ', 'object-sync-for-salesforce' ) . '<a href="%1$s" id="clear-sfwp-cache">%2$s</a>' . esc_html__( ' to see the field listed here.', 'object-sync-for-salesforce' ), | ||
esc_url( get_admin_url( null, 'options-general.php?page=object-sync-salesforce-admin&tab=clear_cache' ) ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
echo sprintf( | ||
esc_html__( 'To map a custom meta field (such as post meta, user meta, term meta, etc.), WordPress must have at least one value for that field. If you add a new meta field and want to map it, make sure to add a value for it and ', 'object-sync-for-salesforce' ) . '<a href="%1$s" id="clear-sfwp-cache">%2$s</a>' . esc_html__( ' to see the field listed here.', 'object-sync-for-salesforce' ), | ||
esc_url( get_admin_url( null, 'options-general.php?page=object-sync-salesforce-admin&tab=clear_cache' ) ), | ||
esc_html__( 'clear the plugin cache', 'object-sync-for-salesforce' ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
esc_html__( 'To map a custom meta field (such as post meta, user meta, term meta, etc.), WordPress must have at least one value for that field. If you add a new meta field and want to map it, make sure to add a value for it and ', 'object-sync-for-salesforce' ) . '<a href="%1$s" id="clear-sfwp-cache">%2$s</a>' . esc_html__( ' to see the field listed here.', 'object-sync-for-salesforce' ), | ||
esc_url( get_admin_url( null, 'options-general.php?page=object-sync-salesforce-admin&tab=clear_cache' ) ), | ||
esc_html__( 'clear the plugin cache', 'object-sync-for-salesforce' ) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
esc_url( get_admin_url( null, 'options-general.php?page=object-sync-salesforce-admin&tab=clear_cache' ) ), | ||
esc_html__( 'clear the plugin cache', 'object-sync-for-salesforce' ) | ||
); | ||
?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
esc_html__( 'clear the plugin cache', 'object-sync-for-salesforce' ) | ||
); | ||
?> | ||
</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
); | ||
?> | ||
</p> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
?> | ||
</p> | ||
</div> | ||
</article> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
</p> | ||
</div> | ||
</article> | ||
<article class="postbox sfwp-o-fieldmap-form sfwp-fieldmap-salesforce-field"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
</div> | ||
</article> | ||
<article class="postbox sfwp-o-fieldmap-form sfwp-fieldmap-salesforce-field"> | ||
<header> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous scan continued.
</article> | ||
<article class="postbox sfwp-o-fieldmap-form sfwp-fieldmap-salesforce-field"> | ||
<header> | ||
<label for="sfwp-salesforce-field-0"><?php echo esc_html__( 'Salesforce Field', 'object-sync-for-salesforce' ); ?></label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
<article class="postbox sfwp-o-fieldmap-form sfwp-fieldmap-salesforce-field"> | ||
<header> | ||
<label for="sfwp-salesforce-field-0"><?php echo esc_html__( 'Salesforce Field', 'object-sync-for-salesforce' ); ?></label> | ||
</header> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
<header> | ||
<label for="sfwp-salesforce-field-0"><?php echo esc_html__( 'Salesforce Field', 'object-sync-for-salesforce' ); ?></label> | ||
</header> | ||
<div class="sfwp-m-fieldmap-subgroup-fields select"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
<label for="sfwp-salesforce-field-0"><?php echo esc_html__( 'Salesforce Field', 'object-sync-for-salesforce' ); ?></label> | ||
</header> | ||
<div class="sfwp-m-fieldmap-subgroup-fields select"> | ||
<select name="salesforce_field[0]" id="sfwp-salesforce-field-0" style="width: 100%;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
</header> | ||
<div class="sfwp-m-fieldmap-subgroup-fields select"> | ||
<select name="salesforce_field[0]" id="sfwp-salesforce-field-0" style="width: 100%;"> | ||
<option value="">- <?php echo esc_html__( 'Select Salesforce Field', 'object-sync-for-salesforce' ); ?> -</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
<div class="sfwp-m-fieldmap-subgroup-fields select"> | ||
<select name="salesforce_field[0]" id="sfwp-salesforce-field-0" style="width: 100%;"> | ||
<option value="">- <?php echo esc_html__( 'Select Salesforce Field', 'object-sync-for-salesforce' ); ?> -</option> | ||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
<select name="salesforce_field[0]" id="sfwp-salesforce-field-0" style="width: 100%;"> | ||
<option value="">- <?php echo esc_html__( 'Select Salesforce Field', 'object-sync-for-salesforce' ); ?> -</option> | ||
<?php | ||
$salesforce_fields = $this->get_salesforce_object_fields( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
<option value="">- <?php echo esc_html__( 'Select Salesforce Field', 'object-sync-for-salesforce' ); ?> -</option> | ||
<?php | ||
$salesforce_fields = $this->get_salesforce_object_fields( | ||
array( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
<?php | ||
$salesforce_fields = $this->get_salesforce_object_fields( | ||
array( | ||
'salesforce_object' => $salesforce_object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
$salesforce_fields = $this->get_salesforce_object_fields( | ||
array( | ||
'salesforce_object' => $salesforce_object, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous scan continued.
array( | ||
'salesforce_object' => $salesforce_object, | ||
) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
'salesforce_object' => $salesforce_object, | ||
) | ||
); | ||
// allow for api name or field label to be the display value in the <select>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
) | ||
); | ||
// allow for api name or field label to be the display value in the <select>. | ||
$display_value = get_option( $this->option_prefix . 'salesforce_field_display_value', 'field_label' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
); | ||
// allow for api name or field label to be the display value in the <select>. | ||
$display_value = get_option( $this->option_prefix . 'salesforce_field_display_value', 'field_label' ); | ||
foreach ( $salesforce_fields as $salesforce_field ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
// allow for api name or field label to be the display value in the <select>. | ||
$display_value = get_option( $this->option_prefix . 'salesforce_field_display_value', 'field_label' ); | ||
foreach ( $salesforce_fields as $salesforce_field ) { | ||
$disabled = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
$display_value = get_option( $this->option_prefix . 'salesforce_field_display_value', 'field_label' ); | ||
foreach ( $salesforce_fields as $salesforce_field ) { | ||
$disabled = ''; | ||
$key = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
foreach ( $salesforce_fields as $salesforce_field ) { | ||
$disabled = ''; | ||
$key = null; | ||
$needle = $salesforce_field['name']; // the current Salesforce field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
foreach ( $salesforce_fields as $salesforce_field ) { | ||
$disabled = ''; | ||
$key = null; | ||
$needle = $salesforce_field['name']; // the current Salesforce field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$disabled = ''; | ||
$key = null; | ||
$needle = $salesforce_field['name']; // the current Salesforce field. | ||
// check the already mapped fields for the current field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
$key = null; | ||
$needle = $salesforce_field['name']; // the current Salesforce field. | ||
// check the already mapped fields for the current field. | ||
array_walk( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous scan continued.
$needle = $salesforce_field['name']; // the current Salesforce field. | ||
// check the already mapped fields for the current field. | ||
array_walk( | ||
$fieldmap_fields, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
// check the already mapped fields for the current field. | ||
array_walk( | ||
$fieldmap_fields, | ||
function( $v, $k ) use ( &$key, $needle ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
array_walk( | ||
$fieldmap_fields, | ||
function( $v, $k ) use ( &$key, $needle ) { | ||
if ( in_array( $needle, $v['salesforce_field'], true ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
array_walk( | ||
$fieldmap_fields, | ||
function( $v, $k ) use ( &$key, $needle ) { | ||
if ( in_array( $needle, $v['salesforce_field'], true ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$fieldmap_fields, | ||
function( $v, $k ) use ( &$key, $needle ) { | ||
if ( in_array( $needle, $v['salesforce_field'], true ) ) { | ||
$key = $k; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
function( $v, $k ) use ( &$key, $needle ) { | ||
if ( in_array( $needle, $v['salesforce_field'], true ) ) { | ||
$key = $k; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
if ( in_array( $needle, $v['salesforce_field'], true ) ) { | ||
$key = $k; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
$key = $k; | ||
} | ||
} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
} | ||
} | ||
); | ||
// disable fields that are already mapped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
} | ||
); | ||
// disable fields that are already mapped. | ||
if ( null !== $key ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous scan continued.
); | ||
// disable fields that are already mapped. | ||
if ( null !== $key ) { | ||
$disabled = ' disabled'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
// disable fields that are already mapped. | ||
if ( null !== $key ) { | ||
$disabled = ' disabled'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
$disabled = ' disabled'; | ||
} | ||
|
||
if ( 'api_name' === $display_value ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
} | ||
|
||
if ( 'api_name' === $display_value ) { | ||
$salesforce_field['label'] = $salesforce_field['name']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
} | ||
|
||
if ( 'api_name' === $display_value ) { | ||
$salesforce_field['label'] = $salesforce_field['name']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
if ( 'api_name' === $display_value ) { | ||
$salesforce_field['label'] = $salesforce_field['name']; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
$salesforce_field['label'] = $salesforce_field['name']; | ||
} | ||
|
||
if ( false === $salesforce_field['nillable'] ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
$salesforce_field['label'] = $salesforce_field['name']; | ||
} | ||
|
||
if ( false === $salesforce_field['nillable'] ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
if ( false === $salesforce_field['nillable'] ) { | ||
$salesforce_field['label'] .= ' *'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
} | ||
|
||
if ( false === $salesforce_field['nillable'] ) { | ||
$salesforce_field['label'] .= ' *'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous scan continued.
|
||
if ( false === $salesforce_field['nillable'] ) { | ||
$salesforce_field['label'] .= ' *'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
$salesforce_field['label'] .= ' *'; | ||
} | ||
|
||
if ( false === $salesforce_field['updateable'] ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
$salesforce_field['label'] .= ' *'; | ||
} | ||
|
||
if ( false === $salesforce_field['updateable'] ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
if ( false === $salesforce_field['updateable'] ) { | ||
$locked = ' 🔒'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
|
||
if ( false === $salesforce_field['updateable'] ) { | ||
$locked = ' 🔒'; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
if ( false === $salesforce_field['updateable'] ) { | ||
$locked = ' 🔒'; | ||
} else { | ||
$locked = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
$locked = ' 🔒'; | ||
} else { | ||
$locked = ''; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
$locked = ''; | ||
} | ||
|
||
echo sprintf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
} | ||
|
||
echo sprintf( | ||
'<option value="%1$s"%2$s>%3$s%4$s</option>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
|
||
echo sprintf( | ||
'<option value="%1$s"%2$s>%3$s%4$s</option>', | ||
esc_attr( $salesforce_field['name'] ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous scan continued.
|
||
echo sprintf( | ||
'<option value="%1$s"%2$s>%3$s%4$s</option>', | ||
esc_attr( $salesforce_field['name'] ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo sprintf( | ||
'<option value="%1$s"%2$s>%3$s%4$s</option>', | ||
esc_attr( $salesforce_field['name'] ), | ||
esc_attr( $disabled ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
'<option value="%1$s"%2$s>%3$s%4$s</option>', | ||
esc_attr( $salesforce_field['name'] ), | ||
esc_attr( $disabled ), | ||
esc_html( $salesforce_field['label'] ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
'<option value="%1$s"%2$s>%3$s%4$s</option>', | ||
esc_attr( $salesforce_field['name'] ), | ||
esc_attr( $disabled ), | ||
esc_html( $salesforce_field['label'] ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
esc_attr( $salesforce_field['name'] ), | ||
esc_attr( $disabled ), | ||
esc_html( $salesforce_field['label'] ), | ||
esc_attr( $locked ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
esc_attr( $disabled ), | ||
esc_html( $salesforce_field['label'] ), | ||
esc_attr( $locked ) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 3 (Generic.WhiteSpace.ScopeIndent.Incorrect).
esc_html( $salesforce_field['label'] ), | ||
esc_attr( $locked ) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
esc_attr( $locked ) | ||
); | ||
} | ||
?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
); | ||
} | ||
?> | ||
</select> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
} | ||
?> | ||
</select> | ||
<p class="description"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Error: Line indented incorrectly; expected at least 7 tabs, found 2 (Generic.WhiteSpace.ScopeIndent.Incorrect).
What does this PR do?
How do I test this PR?