Skip to content

Commit

Permalink
Merge pull request #2194 from weather-gov/jt/dss-builder-wfo-rematch
Browse files Browse the repository at this point in the history
dss builder: bugfix to accommodate 4 char WFO ids
  • Loading branch information
jamestranovich-noaa authored Dec 20, 2024
2 parents 9f34ab1 + 4fb3101 commit a3b1e72
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,16 @@ public function getLatestNodeFromWFO($wfo, $nodeType)

public function getLatestWeatherStoryImageFromWFO($wfo, $nodeType)
{
// we get canonical four letters from the DSS builder. omit the first character.
$truncatedWFO = substr($wfo, 1);
// get the latest weather story upload that matches the grid WFO.
$nodeID = $this->entityTypeManager
->getStorage("node")
->getQuery()
->accessCheck(false)
->condition("status", 1)
->condition("type", $nodeType)
->condition("field_office", $wfo)
->condition("field_office", $truncatedWFO)
->sort("changed", "DESC")
// Only get the first one.
->range(0, 1)
Expand Down

0 comments on commit a3b1e72

Please sign in to comment.