Skip to content

Commit

Permalink
Fix setting VIP_ORG_ID in Tracks_Event (#5921)
Browse files Browse the repository at this point in the history
* Fix setting VIP_ORG_ID in Tracks_Event

* update tests

* Actually use integers
  • Loading branch information
sanmai authored Oct 12, 2024
1 parent ad5b330 commit 4f8794e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion telemetry/tracks/class-tracks-event-dto.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Tracks_Event_DTO {

public string $vipgo_env;

public string $vipgo_org;
public int $vipgo_org;

public bool $is_vip_user = false;
}
2 changes: 1 addition & 1 deletion telemetry/tracks/class-tracks-event.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected function process_properties(
// Set VIP organization if it exists.
if ( defined( 'VIP_ORG_ID' ) ) {
$org_id = constant( 'VIP_ORG_ID' );
if ( is_string( $org_id ) && '' !== $org_id ) {
if ( is_integer( $org_id ) && $org_id > 0 ) {
$event->vipgo_org = $org_id;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/telemetry/tracks/test-class-tracks-event.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Tracks_Event_Test extends WP_UnitTestCase {

protected const VIP_GO_APP_ENVIRONMENT = 'test';

protected const VIP_ORG_ID = '17';
protected const VIP_ORG_ID = 17;

private WP_User $user;

Expand Down

0 comments on commit 4f8794e

Please sign in to comment.