Skip to content

Commit

Permalink
VACMS-15559 Cleaned up function names and some comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
swirtSJW committed Feb 1, 2024
1 parent c42489b commit ad009f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ protected function migrateAppointmentIntroType(): void {
* Move the appointment text from the service node to the service location.
*/
protected function migrateAppointmentIntroText(): void {
// Moving from: field_hservice_appt_leadin
// Moving to: paragraph.service_location.field_appointment_intro_text
// Needs a bifurcation for VAMC vs VBA.
// Moving from: field_hservice_appt_leadin.
// Moving to: paragraph.service_location.field_appointment_intro_text.
$intro_text = $this->facilityService->get('field_hservice_appt_leadin')->value;
$this->serviceLocation->set('field_appt_intro_text_custom', $intro_text);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
* Indicating the run is complete.
*/
function run(): string {
script_library_toggle_post_api_data_check(TRUE);
script_library_skip_post_api_data_check(TRUE);
$sandbox = ['#finished' => 0];
do {
print(va_gov_vamc_deploy_migrate_service_data_to_service_location($sandbox));
} while ($sandbox['#finished'] < 1);
// Migration is done.
script_library_toggle_post_api_data_check(FALSE);
script_library_skip_post_api_data_check(FALSE);
return "Script run complete.";
}

Expand Down
8 changes: 4 additions & 4 deletions scripts/content/script-library.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function script_library_sandbox_init(array &$sandbox, $counter_callback, array $
else {
// Something went wrong could not use callback. Throw exception.
throw new UpdateException(
"Counter callback {$counter_callback} provided in _va_gov_vamc_sandbox_init() is not callable. Can not proceed."
"Counter callback {$counter_callback} provided in script_library_sandbox_init() is not callable. Can not proceed."
);
}
}
Expand Down Expand Up @@ -401,12 +401,12 @@ function script_libary_map_to_value(string|null $lookup, array $map, bool $stric
* @param bool $state
* TRUE to toggle the settings on, FALSE to toggle them off.
*/
function script_library_toggle_post_api_queueing(bool $state): void {
function script_library_disable_post_api_queueing(bool $state): void {
$on = ($state) ? 1 : 0;
$config_post_api = \Drupal::configFactory()->getEditable('post_api.settings');
$config_post_api->set('disable_queueing', $on)
->save(FALSE);
script_library_toggle_post_api_data_check($state);
script_library_skip_post_api_data_check($state);
}

/**
Expand All @@ -415,7 +415,7 @@ function script_library_toggle_post_api_queueing(bool $state): void {
* @param bool $state
* TRUE to toggle the settings on, FALSE to toggle them off.
*/
function script_library_toggle_post_api_data_check(bool $state): void {
function script_library_skip_post_api_data_check(bool $state): void {
$on = ($state) ? 1 : 0;
$config_va_gov_post_api = \Drupal::configFactory()->getEditable('va_gov_post_api.settings');
$config_va_gov_post_api->set('bypass_data_check', $on)
Expand Down

0 comments on commit ad009f6

Please sign in to comment.