Skip to content

Commit

Permalink
Merge pull request #1857 from GSA/1846-needs-review-no-json-file
Browse files Browse the repository at this point in the history
1846 No JSON file generation for needs review
  • Loading branch information
scottqueen-bixal authored Oct 9, 2024
2 parents 52b78d7 + 465d940 commit cac6263
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,22 @@ use Drupal\usagov_benefit_finder_api\Controller\LifeEventController;
* @param Node $node
*/
function usagov_benefit_finder_api_node_update(Node $node) {
$generate_json_files = 1;
$url = _usagov_benefit_finder_api_get_current_page_url();

if (strpos($url, "/admin/content") === FALSE) {
if ($node->hasField('moderation_state')) {
$moderation_state = $node->get('moderation_state')->value;
if ($moderation_state == 'needs_review') {
$generate_json_files = 0;
}
}
}
else {
$generate_json_files = 0;
}

if ($generate_json_files == 1) {
_usagov_benefit_finder_api_batch_generate_json_data_files($node);
}
else {
Expand Down

0 comments on commit cac6263

Please sign in to comment.