Skip to content

Commit

Permalink
Merge pull request #1925 from GSA/1770-ajax-http-error
Browse files Browse the repository at this point in the history
1770 fix ajax http error
  • Loading branch information
scottqueen-bixal authored Nov 12, 2024
2 parents cec87c6 + 89936e2 commit da79a63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,11 @@ public function getData($id) {
if (empty($life_event_form_node)) {
$result = [];
$json = json_encode($result, JSON_PRETTY_PRINT);
print_r("<p>JSON Data<pre>");
print_r($json);
print_r("</pre>");
if ($this->displayData) {
print_r("<p>JSON Data<pre>");
print_r($json);
print_r("</pre>");
}
return $result;
}

Expand Down
4 changes: 4 additions & 0 deletions usagov_benefit_finder/src/Traits/BenefitFinderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ public function getLifeEventForm($nid, $mode) {
public function getNode($nid, $mode) {
$node = Node::load($nid);

if (!$node) {
return NULL;
}

if ($node->hasField('moderation_state')) {
$moderation_state = $node->get('moderation_state')->value;
if ($moderation_state == 'archived') {
Expand Down

0 comments on commit da79a63

Please sign in to comment.